I am currently viewing a horizontal paging tutorial: http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-horizontal-view-paging/
For testing purposes, I added the following line as the first line in the instantiateItem (...) function:
Log.d("SimpleViewPagerActivity", "Position " + position);
(The following is misleading, so it would be better if you try the example yourself to find out what I'm talking about in the next paragraph): In this example, there are 5 ViewPager positions (which are based on zero), and activity is set to start at the position 2. When I start Activity, the log says that the starting position goes from 1, then 2, and then 3. If I scroll left, the log says that the position is 0. When I swipe left again, there is no log message. From here I scroll to the right, and now the position is 2. I sit again to the right, and the position is 3. I sit at other positions on the right, and I get results that I can not explain.
Can someone explain the variable "position" in instatiateItem () or tell me somewhere where it is being explained? I am in the Android v.6 compatibility pack
source share