Hi, It's apparent through all the posts I've read that a ListView
object registered to a ContextMenu object can't use the ListView's
getSelectedItemPosition() method in touch mode, and for good reasons
I'm
sure. So how can I tell what ListView item was
actually long touched?

If the index we get from getSelectedItemPosition() is -1,
we know they probably long touched a ListView item, so again, where do
I look for the ListView item position that was long touched?? Below is
some code I'm working with the commented line after 'if(index < 0)' is
where I want to set the index to the touched ListViewItem... how do I
do this?

[code]
@Override public boolean onContextItemSelected(MenuItem item)
   {
       boolean value = false;
       super.onContextItemSelected(item);

       int index = taskListView.getSelectedItemPosition();
       //an index of -1 probably means that we used touch, not the
trackball
       if(index < 0)
               ;   //index = ??????
       switch(item.getItemId())
       {
               //dostuff
       }
       return value;
   }
[/code]

Thanks in advance for any useful help!
-Greg

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

Reply via email to