I am working on it now. I did what CommonsWare suggested about his appeal. I basically took the source code of PopupMenu.java and replaced the import of packages with actionbarsherlock equivalents. It seems to work just fine on the gingerbread and ics devices I tested. Although the trick is in the actionbarsherlocks of the MenuPopupHelper class, I had to comment on lines that reference the View_HasStateListenerSupport, for example:
((View_HasStateListenerSupport)anchor).addOnAttachStateChangeListener(this);
for some reason. If I did not, I would get a ClassCastException:
E / AndroidRuntime (9197): FATAL EXCEPTION: main E / AndroidRuntime (9197): java.lang.ClassCastException: android.widget.Button cannot be attributed to com.actionbarsherlock.internal.view.View_HasStateListenerSupport E / AndroidRuntime (9197): at com .actionbarsherlock.internal.view.menu.MenuPopupHelper.tryShow (MenuPopupHelper.java:121) E / AndroidRuntime (9197): at com.actionbarsherlock.internal.view.menu.MenuPopupHelper.show (MenuPopupHelper.java:102)
I'm not sure that commenting on this listener can cause problems for other classes that use MenuPopupHelper or why they throw this exception (possibly an error). But I thought I would share what I tried, so this can help anyone who is looking at it.
Robert
source share