views:

77

answers:

1
  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);
A: 

Do you mean to be using setOnLongClickListener()?

Aaron C
I 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