title: View pager is taking time to load pages
body: <p>I have an Activity with ListView and ViewPager below it. Initially my ViewPager is not visible and becomes visible after clicking a toggle button. The ViewPager contains 4 tabs. 1st tab contains ListView of texts, 2nd tab contains all the music/mp3 inside the phone, 3rd tab shows all the images inside phone and the 4th tab shows all the videos inside the phone.
   I have setOffscreenPageLimit(3) to avoid views being created again and again.</p>
  
  <p>To avoid fetching data for the tabs again and again, I used singleton classes.</p>
  
  <p>Below is the class which gives me texts</p>
  
  <pre><code>public class TextManager {
  
  private static ArrayList&lt;String&gt; text = new ArrayList&lt;&gt;();
  private static TextManager instance;
  
  public static TextManager getInstance() {
      if(instance == null) {
          instance = new TextManager();
      }
      return instance;
  }
  
  public TextManager() {
      // get all the texts here
  }
  
  public ArrayList&lt;String&gt; getText() {
      return text;
  }
  }
  </code></pre>
  
  <p>Same is the class for Music, Images and Video. Only difference is in the constructor to get the data from phone.</p>
  
  <p>When my activity is visible, the ViewPager is not visible. ViewPager's visibility is controlled by a toggle button. I clicked on the toggle button, now the ViewPager becomes visible. The first time ViewPager becomes visible it makes 1-2 seconds. However once its visible if I hide and show the ViewPager again and again, it hides and becomes visible instantaneously, which is not the case for first time.</p>
  
  <p>If I go back to previous Activity and comes on this activity, still it takes time for first time and becomes visible fast for the rest of time.</p>
  
  <p>I want the view to be instantaneously visible even for the first time. How can I achieve this?</p>