Search code examples
androidviewflipper

position in viewFlipper


How to find current view position in viewFlipper..

Suppose it is the last or the first child inside viewFlipper

  <ViewFlipper
            android:id="@+id/imageFrames"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@android:drawable/screen_background_dark" >
 <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"><RelativeLayout>
<RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"><RelativeLayout>
<RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"><RelativeLayout>
        </ViewFlipper>

Solution

  • You can use viewFlipper.getDisplayedChild().