【发布时间】:2011-08-17 14:40:49
【问题描述】:
我的活动中有一个按钮,按下它,将调用以下方法 -
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?
}
我知道如何以编程方式为活动执行此操作 - 创建线性布局和列表视图,最后在活动的上下文中使用 addContentView。
但是发现很难为上述弹出菜单场景做同样的事情。
【问题讨论】:
标签: android