ah... very good - thanks.
fyi - for anyone else reading this and wants to know - here's what i
did --
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
// info.position is now the position in the GridView that was
selected (zero based index).
}
Thanks for your help.
On Jan 8, 1:25 pm, Romain Guy <[email protected]> wrote:
> You get that position as part of the long press callback.
>
>
>
> On Fri, Jan 8, 2010 at 1:23 PM, sdphil <[email protected]> wrote:
> > so how do I get the position of the item that was long pressed?
>
> > On Jan 8, 1:20 pm, Romain Guy <[email protected]> wrote:
> >> There's no selection in touch mode, that's why you get these results.
>
> >> On Fri, Jan 8, 2010 at 12:07 PM, sdphil <[email protected]> wrote:
> >> > I have googled around and I saw some posts about being in "touch
> >> > screen mode" -- I don't fully understand what that means.
>
> >> > However, I cannot seem to get this call to work - it always returns
> >> > -1.
>
> >> > I am doing a "long press" on an item in a grid view, and I've
> >> > registered for the long press for the entire grid. When I receive a
> >> > long press, I go ask the grid what the selected item is, and it always
> >> > returns -1, even though I can visually see the item selected!
>
> >> > I tried calling GridView.getSelectedView() (in hopes of calling
> >> > GridView.getPositionForView() later), but that returns null.
>
> >> > any help greatly appreciated.
>
> >> > tia.
>
> >> > --
> >> > 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
>
> >> --
> >> Romain Guy
> >> Android framework engineer
> >> [email protected]
>
> >> Note: please don't send private questions to me, as I don't have time
> >> to provide private support. All such questions should be posted on
> >> public forums, where I and others can see and answer them
>
> > --
> > 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
>
> --
> Romain Guy
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support. All such questions should be posted on
> public forums, where I and others can see and answer them
--
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