click - how do I distinguish between longpress and singletap in android? -


i have card game want single tap action on card, , longpress on card shows me bigger image of card. know there gesturelistener, how use it? here code:

gd = new gesturedetector(this, this);       gd.setondoubletaplistener(new ondoubletaplistener()       {           @override           public boolean ondoubletap(motionevent e)           {               log.d("ondoubletaplistener", "ondoubletap");             return false;           }            @override           public boolean ondoubletapevent(motionevent e)           {               log.d("ondoubletaplistener", "ondoubletapevent");             //if second tap hadn't been released , it's being moved               if(e.getaction() == motionevent.action_move)               {                }               else if(e.getaction() == motionevent.action_up)//user released screen               {                }               return false;           }            @override           public boolean onsingletapconfirmed(motionevent e)           {               log.d("ondoubletaplistener", "onsingletapconfirmed");             return false;           }       }); 

errr... yourcard.setonlongclicklistener() ?


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -