Friday, January 8, 2010

[android-developers] GridView.getSelectedItemPosition() always returns -1

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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate