How can I swipe between Activities with ViewPager?

How do I handle asynctask's in ActionBarActivity fragments when ViewPager is used in an Android app?

  • I'm using ActionBarActivity to create 4 tabs. I have used ViewPager to swipe between those 4 tabs. I have asynctask in each fragment. When I swipe from one tab to other/select a tab randomly, handling asynctask has become very messy. I'm new to action bar, so can some one suggest a good approach to handle this situation. My requirement is similar to the functionality of Quora Android app. Can someone shed some light on how to handle this problem?

  • Answer:

    Look at http://androidBootstrap.com (http://www.androidbootstrap.com) code MainActivity#checkAuth method

Raja Nagendra Kumar at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.