[android-developers] Re: GridView: how to select, programmatically?

2008-10-07 Thread tauntz
I haven't tried it myself but you could try android:focusableInTouchMode. From dox: Boolean that controls whether a view can take focus while in touch mode. If this is true for a view, that view can gain focus when clicked on, and can keep focus if another view is clicked on that doesn't have

[android-developers] Re: GridView: how to select, programmatically?

2008-10-06 Thread Romain Guy
You must use setSelection(). But if you are in touch mode when the Activity starts (if you launched your activity using the mouse in the emulator for instance), then the selection will not show. Selection and focus do not exist in touch mode. That's the way it is, don't try to work around it :)