Wow, it's a good idea! Tanks for your help!
2008-05-06 Chenguo 发件人: vol 发送时间: 2008-05-06 21:33:54 收件人: Android Developers 抄送: 主题: [android-developers] Re: how to detect longpress on touchscreen? As I understand, the DOWN event is triggered the moment the user presses the screen. Thus, by definition, the time the user has spent pressing the screen is 0ms. You will have to wait until the UP event to determine how long the user has been pressing on the screen. Alternately, if you want a menu to appear while the user is still pressing the screen, create a delayed message and send it to your handler in the DOWN method, and send a cancellation in the UP method. ollie wrote: > Thanks.I have thought about this method, but it seems that only DOWN, > UP and MOVE actions can trigger onTouchEvent.Indeed, i can use > getDownTime() on UP action, but how to use getDownTime() after the > DOWN action? > I wanna detect the longpress event like the MapActivity. > > On May 4, 10:26 pm, "Evan JIANG" <[EMAIL PROTECTED] > wrote: > > Hi, > > What about in onTouchEvent, check the MotionEvent event's getDownTime()? > > > > Regards, > > Evan JIANG > > > > On Sun, May 4, 2008 at 10:16 PM, Chenguo <[EMAIL PROTECTED] > wrote: > > > > > hi,everyone! > > > Can anybody tell me that how to detect longpress on touchscreen > and get the longpress-point's location in ImageView?I tried to use > OnLongClickListener, but it seems that onTouchEvent can not work when > OnLongClickListener is set. > > > I suffered this for days.Can anybody give me some advice? > Thanks! > > > > > -------------- > > > Chenguo > > > 2008-05-04 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

