4

I have a gallery and I want to set a default selected item when I launch the activity.

The goal is to have the contain of the first item appears automatically.

Is there anyway to do this ?

thx a lot for answers.

Atheh
  • 615
  • 1
  • 6
  • 11

2 Answers2

7

Use method setSelection(position, animate)

rds
  • 26,253
  • 19
  • 107
  • 134
  • thanks it works. I found this solution too and I realized that my problem was somewhere else ^^ – Atheh Jul 20 '11 at 08:42
0

Use this method:

gallery.setSelected(true);
gallery.setSelection(position);
user3469914
  • 79
  • 1
  • 1