android - How to use ContextMenu on long click on the screen(on tablelayout for which parentlayout is scrollview)? -


how use contextmenu on long click on screen(on tablelayout parentlayout scrollview)?

i have used scrollview within used tablelayout , on longclicking need display contextmenu.

on longclick able display toast not contextmenu. within onlongclick() method not able implement oncreatecontextmenu() , oncreatecontextmenu() methods.

can please me in regard??if thankful u...thanks !!!

some code useful, guessing defining , onlongclicklistener inline this

oncreate {       tablelayout t = (tablelayout) this.findviewbyid(r.id.mytable)      t.setonlongclicklistener(new onlongclicklistener()      {          void onlongclick(view v)          {                //here think you're trying make contextmenu          }      }  } 

if i'm right, because you're trying make context menu inner class, need reference outer class. need call:

 [nameofyourclass].this.oncreatecontextmenu(.....) 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -