So you created an overflow menu that contains another sub-menu in Android’s ActionBar. Everything works well after you styled the background color of Widget.AppCompat.PopupMenu.

Once you tried a long click on the overflow MenuItem and proceed to selected a sub MenuItem, you notice the selected background color of the item is not transparent.

The cause for this is because you used android:background. The correct attribute to use is android:colorBackground.

That should fix it.

See sample XML code:

And in your theme style, add this:

Sad to say, there is no workaround if you insist on using ShareActionProvider. Sure, it would definitely look nice if the popup menu for various Share apps will be displayed just below the menu item.

Since there is really no way, the only solution left is to not use ShareActionProvider and use Intent.createChooser() instead.

The results are the same, except that the popup menu will appear at the center of the screen instead of below the menu item in the ActionBar.

And the most important thing is that your icon will look crisp rather than the blurry one.

Here is a sample code.

Related Posts Plugin for WordPress, Blogger...