I am an intermediate level programmer in android. Now I am developing an app which has a view. When I click that view I have to display a popup menu.
I got the following code from android developer site
public void showPopup(View v) {
PopupMenu popup = new PopupMenu(this, v);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.actions, popup.getMenu());
popup.show();
}
But this code is working only on API 11 and above.
Can anyone help me so that I can make a popup menu that supports also GingerBread?
you can use PopupWindow and showAsDropDown() instead.
OR http://developer.android.com/guide/topics/ui/menus.html#FloatingContextMenu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With