stanna stanna - 10 months ago 101
Android Question

Remove most recent share app

How would i get rid of that little box that has the messaging app while retaining the share icon?

Share intent with most recent app

app:showAsAction="always" />

Answer Source

If you don't want to show recent share app then remove ShareActionprovider. and add a icon to menu and handle share action like this

Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); 
String shareBody = "Here is the share content body";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));