Android 如何将图像发送到gallery以设置壁纸?
我试图使用默认的gallery应用程序集成设置为壁纸选项,我不知道如何使用intent将图像发送到gallery。我附上fb应用程序的样本,看看它是什么样子Android 如何将图像发送到gallery以设置壁纸?,android,android-intent,android-gallery,Android,Android Intent,Android Gallery,我试图使用默认的gallery应用程序集成设置为壁纸选项,我不知道如何使用intent将图像发送到gallery。我附上fb应用程序的样本,看看它是什么样子 问题是图像没有传递到库中。我可以将内部文件用于Uri.fromFile()吗? Intent emailIntent = new Intent(Intent.ACTION_ATTACH_DATA); emailIntent.setDataAndType(Uri.fromFile(f
问题是图像没有传递到库中。我可以将内部文件用于Uri.fromFile()吗?
Intent emailIntent = new Intent(Intent.ACTION_ATTACH_DATA);
emailIntent.setDataAndType(Uri.fromFile(fileForImage), "image/*");
//emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(fileForImage));
startActivity(emailIntent);
Toast.makeText(getApplicationContext(), "Image is saved to "+Constants1.APPNAME+" folder", Toast.LENGTH_SHORT).show();
Intent emailIntent = new Intent(Intent.ACTION_ATTACH_DATA);
emailIntent.setDataAndType(Uri.fromFile(fileForImage), "image/*");
//emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(fileForImage));
startActivity(emailIntent);
Toast.makeText(getApplicationContext(), "Image is saved to "+Constants1.APPNAME+" folder", Toast.LENGTH_SHORT).show();