Change Fragment with ViewPager
I am using PagerSlidingTab Library for ViewPager . And I want to change Fragment while scrolling of tabs. It is working fine. Check out my code. I am using AsynTask() on each Fragment . When the App opens with the MainActivity, First Fragment is attached to the activity, But It shows two AsynTask() dialog message, one from First and another from Second Fragment . And When I scroll to second tab, It shows dialog message of Third Fragment . So, If I scroll from left to right in tabs, the Fragment right to the current fragment is displayed and if i scroll from right to left, the Fragment left to