android - How to get on which ListView has been a ContextItem selected? -


itemprop = "text">

I have three listviews, each of which is an activity with three different cursors, but all the same ContextMenu Show / Resolution code And when the selection event fire, I want to refresh this listView.

I can not use menuInfo.targetView as the ListView linear linearLayout holds, and not ListView.

In this method

  public boolean onContextItemSelected (MenuItem item)  

How is it possible?

you see the line tag s / holders S are appending adapter , right?
adapter is a tag class per
Now,

  @Override Public Boolean onContextItemSelected (MenuItem Item) {AdapterContextMenuInfo Info = (AdaptContactManuInfo) Item .getMenuInfo (); Class & lt ;? & Gt; Tag class = info.targetView.getTag (). GetClass (); If (tagClass == FirstTag.class) {// first list} else if (tagClass == SecondTag.class) {// second one} else {new throwing IllegalArgumentException ('I've screwed this hack.'); } // ...}  

Comments