0

I have a GridView displaying buttons to different screens of my app. When this grid screen, the first cell is selected. Is there a way to programmatically have no cells selected when the screen launches? Or do I have to hide the selector?

Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
Andrew
  • 20,756
  • 32
  • 99
  • 177

1 Answers1

0

When this grid screen, the first cell is selected.

That should only be true if the user was using the navigator (D-pad, trackball, etc.) in the previous activity.

Is there a way to programmatically have no cells selected when the screen launches?

Generally, the user determines this based on whether they are in touch mode or not. You could try setSelection(-1) or something, but I would not be surprised if this fails to work.

Or do I have to hide the selector?

I would recommend just following the platform conventions. If the user is using the D-pad or trackball, they probably want to use the D-pad or trackball, and disabling the selector will simply make them frustrated with you and your app. Please see the article I linked to above for more details on touch mode and why it works the way it does.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Ah, I see why this is happening. When I launch the app, the user is taken to a login screen. One of the EditTexts for username/pw will have focus. I type and then hit the enter button, which moves focus to the login button, but this is apparently also like using the trackpad to scroll to the next object. – Andrew Oct 11 '10 at 19:42