Boozel wrote:
> Can someone please help me find which item was long clicked
> in this method i need to determine which item was clicked so that if
> it is a favorite or not already i can change the "Add to Favorites"
> accordingly.
> 
> public void onCreateContextMenu(ContextMenu menu, View v,
> ContextMenuInfo menuInfo)
>       {
>               super.onCreateContextMenu(menu, v, menuInfo);
>               menu.setHeaderTitle("Menu");
>               menu.add(0, 0, 0, "Add to Favorites");
>       }

Cast menuInfo to an AdapterView.AdapterContextMenuInfo, and you can get
the _ID, position, and View of the row in your ListView that was
long-tapped-upon.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in Germany, 18-22 January 2010: http://bignerdranch.com

--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to