On Wed, Feb 17, 2016 at 4:35 AM, <[email protected]> wrote:

> Handling regular button clicks is no issue, however I'd also like to have
> a long press for both buttons where a context menu is shown.
>

Android is moving away form long-press for context menus. Using it for
buttons within a list item sounds doubly bad.
https://www.google.com/design/spec/patterns/gestures.html#gestures-touch-mechanics

The same menu should be shown, however choosing an entry should be
> certainly specific to the chosen button.
>
> Using registerForContextMenu() in the activity is no problem. I can also
> easily get the entry position. However I do not seem to be able to find out
> which button brought it up.
>

You'd probably need to create a custom ContextMenuInfo object that you pass
along when the long click happens indicating the view id that was long
clicked.
http://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html


But really, you should come up with a better design for whatever it is
you're doing. Good luck.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CANCScgg79qwcGzXqOsXNE_TjxJCZChtGATqzVOtz0cf9aYiRzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to