3

I have viewFlipper with three views insdie,

  1. v1.id = 0

  2. v2.id = 1

  3. v3.id = 2

How could I know/get the current view id ?

i have textbox which i need to update according the current view id

getDisplayedChild() returns sometimes numbers bigger then 3 like 4, 5

Sherif elKhatib
  • 45,786
  • 16
  • 89
  • 106
Tomer Mor
  • 7,998
  • 5
  • 29
  • 43

2 Answers2

1

add only those three views only. i think you are adding views again and again so that the view's will be repeated and id will be more than 3. check your code again.

ilango j
  • 5,967
  • 2
  • 28
  • 25
-2

If you really need an id and not an index, then viewFlipper.getCurrentView().getId() should work. Also it looks like you really have more than 3 views in your flipper.

Konstantin Burov
  • 68,980
  • 16
  • 115
  • 93