context menu android -


i have listactivity in android. context menu open when press item of listview.

the problem occurs when close context menu , press same item (the other items have no problems)

if press text, context menu doesn't open, if press in white area contextmenu appears.

¿what's problem?

oncreate method:

lv = getlistview();      lv.setonitemclicklistener(new onitemclicklistener() {         public void onitemclick(adapterview<?> parent, view view, int position, long id) {              textview text = (textview) view.findviewbyid(r.id.label);             if (!text.gettag().tostring().equals("-1"))             {                 registerforcontextmenu(text);                 opencontextmenu(text);             }           }        }); 

if want context menu listview, call registerforcontextmenu() in oncreate() of activity, passing in listview. here sample project demonstrating this, including showing how determine particular row in listview user long-tapped upon bring context menu.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -