android - How to avoid ontouchlistner to stop working when clicked on imageview -


in application, have set ontouchlistener , onclicklistener imageview. problem when click imageview both ontouchlistener , onclicklistener working. want avoid ontouchlistener when clicked on image, , when dragging imageview ontouchlistener should work , onclicklistener should avoided. suggestions...

below code:

imageview.setonclicklistener(m_onclicklistner); imageview.setontouchlistener(this);  @override public boolean ontouch(view v, motionevent event) {     if (event.getaction() == motionevent.action_down) {      }else if (event.getaction() == motionevent.action_move) {      }     if (event.getaction() == motionevent.action_up) {      }     return true; }  onclicklistener m_onclicklistner = new view.onclicklistener() {          @override         public void onclick(view v) {          }     }; 

i case should use setonlongclicklistener dragging.

imageview.setonlongclicklistener(new onlongclicklistener() {     @override     public boolean onlongclick(view v)     {         // todo auto-generated method stub         return false;     } }); 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -