Reputation: 43
I am sharing an image to different apps using an intent as ACTION_SEND, but I also want to add an option of "Save image to gallery", in the same menu.
Is there any way to do it ? Please help me somebody. Thanks in advance.
Upvotes: 1
Views: 2085
Reputation: 35549
you have to create custom dialog for that. add all ACTION_SEND items to your list and "save image to gallery" option also. put this listview in some dialog.
refer this :
https://github.com/soarcn/BottomSheet
use this code to get available items of ACTION_SEND
Intent galleryIntent = new Intent(Intent.ACTION_SEND);
List<ResolveInfo> listGel = context.getPackageManager().queryIntentActivities(galleryIntent, 0);
for (ResolveInfo res : listGel) {
Log.e("package",res.activityInfo.packageName);
Log.e("name",res.activityInfo.name);
Log.e("proname",res.loadLabel(context.getPackageManager()).toString());
}
Upvotes: 0