Sunday, April 24, 2011

[android-developers] Intercept/override context menu on EditText long-press?

I want to intercept an EditText long-press and do something with it
other than present a contextual menu. Obviously, I cannot simply
disable the GestureDetector's long press detection because I do in
fact want to use the long press. By the time onCreateContextMenu() is
called, it seems to be too late to prevent the contextual menu from
occurring. Not calling super.onCreateContextMenu for example doesn't
prevent it, nor does anything else I have tried...and
onCreateContextMenu() is called before onLongPress(), so the answer to
my question can't be some behavior in onLongPress(). Should I be
doing something in dispatchTouchEvent(), onDown(), or showPress() to
accomplish this goal? Those seem to be the only methods that are
called before onCreateContextMenu().

Thanks.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate