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
Post a Comment