In My application, I have used the ViewPager. Like,
(say main.xml)
My Problem is getItem() method is called twice on First time
This is not the problem, this is default feature of FragmentPagerAdapter
. Its good for you to swipe from this page to the next one and previous one.
the view displayed in the emulator is 0th index, but got 1st Index value in the FragmentActivity
I got the same issue, and I know why. This because you used same Fragment in View Pager
.
How to fix this is separate Fragments by using different Fragment
.