FragmentStatePagerAdapter takes few seconds to load fragment

233 views Asked by At

I am using FragmentStatePagerAdapter, in that i have 7 pages. If i open any activity from one of these fragments then it gets opened instantly. But if i try to click on back press. Then opened activity takes few seconds to kill that activity and reload the fragment. I have done nothing in on resume or in on back press. On debug i found that setPrimaryItem() and getCount() of adapter is called for 2-3 times and after that it finished my activity.

Can any one provide me work around for this. Activity should be killed instantly without any delay.

0

There are 0 answers