class - Android: Use onTouch and OnLongClick in my view -


i have problem. impossible use onlongclick in view element. created class , in there have 2 processings of events of ontouch , onlongclick.

public class myclass extends surfaceview implements surfacehilder.callback { ... //i define thread , constructor ... public boolean ontouch(motionevent ev) { ... // here work in touch events ... return true; } 

now correct me declare onlongclick in class. desirable knew coordinates of defined event.

not sure if you're looking for, onlongpress use this:

  buttonname.setonlongclicklistener(new view.onlongclicklistener() {          public boolean onlongclick(view v) {              //whatever method want call              return true;         }     }); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -