-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Handling context menu
Eduardo Kozachek edited this page Jan 8, 2014
·
1 revision
If you used ListView with context menu and then changed ListView to StickyListHeadersListView, then keep in mind, that view.getId()
will be different so you should change your onCreateContextMenu()
code accordingly:
before:
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
if (view.getId() == R.id.sidemenu_links) {
}
}
after:
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
if (((View)view.getParent()).getId() == R.id.sidemenu_links) {
}
}