fileListView = new FileListController(this);
fileListView.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
pWindow.dismiss();
}
});
pWindow = new PopupWindow(fileListView);
pWindow.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
pWindow.setTouchable(true);
button_show.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (pWindow.isShowing()) {
pWindow.dismiss();
return;
}
pWindow.showAsDropDown(v);
pWindow.setFocusable(true);
pWindow.update();
}
});
fileListView.listView.setLongClickable(true);
registerForContextMenu(fileListView.listView);
views:
77answers:
1I have a Listview on a PopupWindow. Everything works fine except for the listview's ContextMenu. I have attached a listener to the Listview (OnCreateContextMenuListener) but it doesn't fire when I do a long press. Anybody encountered this problem? Hoping you could help me with this problem.
zhujian
2010-08-19 05:42:58