I m trying to set image as wallpaper from stored in drawable folder with default android way like this
I have tried as answered in other questions here.
But i m getting error as "No apps can perform this action"
My code to get uri-
Uri uri=Uri.parse("android.resource://drawable/sharingan.jpg");
Intent intent=new Intent(Intent.ACTION_ATTACH_DATA);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setDataAndType(uri,"image/*");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra("mimeType","image/*");
startActivity(Intent.createChooser(intent,"Set as"));
Is there another way to achieve this? Or is there something wrong with my uri ?