PopupMenu displays Menu's, not ListView's, at least as seen from the API.

Perhaps you can use an AlertDialog with this instead:

http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setSingleChoiceItems(android.widget.ListAdapter, int, android.content.DialogInterface.OnClickListener)

If menu is what you really want, create a Menu from code and add items from the adapter, using:

http://developer.android.com/reference/android/view/Menu.html#add(int, int, int, java.lang.CharSequence)

-- Kostya

03.05.2011 14:33, droid-stricken пишет:
Hi,

[I have posted the same query on StackOverflow forum as well. So,
kindly excuse the re-posting here - was not sure if this was a
beginner's level question or a beyond beginner's level]

I have a button in my activity, pressing upon which, the following
method gets called -

private ArrayList<ListView>  myListViewList;
private ArrayList<MyListAdapter>  myAdapterList;

public void onPopupButtonClick(View button) {
     Log.v(TAG, "onPopupButtonClick");

     PopupMenu popup = new PopupMenu(this, button);
     Menu menu = popup.getMenu();

     // how do i display the myListViewList as items of in this popup
menu
     // i.e how do i inflate myListViewList into menu object?

}
I know how to do this programatically for an activity - creating
linearlayouts and listViews and finally using addContentView on the
activity's context.

But finding it hard to do the same for the popup menu scenario as
described above.

Any help is greatly appreciated.

TIA.



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to