Fix disable non clickable item in ContextMenuAdapter
This commit is contained in:
parent
d542766dc8
commit
a609bc6dd9
2 changed files with 7 additions and 1 deletions
|
@ -111,6 +111,12 @@ public class ContextMenuAdapter {
|
|||
mIconsCache = app.getIconsCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int position) {
|
||||
final ContextMenuItem item = getItem(position);
|
||||
return item != null && item.getItemClickListener() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
// User super class to create the View
|
||||
|
|
|
@ -860,7 +860,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
ContextMenuItem item = contextMenuAdapter.getItem(position);
|
||||
ContextMenuAdapter.ItemClickListener click = item.getItemClickListener();
|
||||
if (click.onContextMenuClick(simpleListAdapter, item.getTitleId(),
|
||||
if (click != null && click.onContextMenuClick(simpleListAdapter, item.getTitleId(),
|
||||
position, false)) {
|
||||
mapActivity.closeDrawer();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue