That works great, thankyou.

One more thing, though. I have tried to mess around with
onContextItemSelected() and attempted to get the original text from
the list item I clicked through the ContextMenuInfo interface, but
there doesn't seem to be a clear way to achieve this. All I basically
need to (lets say, set a favorite) is the title or string of the list
item I clicked to bring up the context menu.

Thanks.

On Oct 15, 1:00 am, Jason Proctor <jason.android.li...@gmail.com>
wrote:
> the "dialog" that comes up when you long-click on a contact is
> actually a contextual menu.
>
> i've done this in my app for much the same reason and it's
> straightforward. call activity.registerForContextMenu(view), then
> implement View.OnCreateContextualMenuListener in your activity. when
> the user long taps on "view", onCreateContextMenu() gets called off
> your activity. you get passed a Menu reference, which you build
> according to your context. this gets shown, the user picks one, and
> so forth.
>
> hth
>
> >I'm attempting to implement a long click listener on a list activity
> >that simply works the same way as when you long click on a contact in
> >your address book. That is, displaying an AlertDialog with a list of
> >options (one option might be to add the value clicked as a favorite or
> >something). I've attempted to use something like the following..
> >http://pastie.org/655392I realize this is wrong and my implementation
> >is totally screwed up, but I'm getting really confused with how to
> >implement this. Any help would be great. Thanks
>
> >Regards,
> >Lee
>
> --
> jason.vp.engineering.particle
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to