Search code examples
androidviewflipper

viewflipper get the current display child id


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


Solution

  • 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.