title: How to make fragments load faster?
body: <p>I am currently developing a fragment which contains lists of albums.
  The structure is pretty simple:</p>
  
  <p>Horizontal slider contains LinearLayour (horizontal). In order to add an album with songs list I have created a separate view which consists of cover image and a listview. The listview is custom as well where items are linearlayout with 3 textviews. Then I inflate it, populate list, and add to the Horizontal slider.</p>
  
  <p>The issue occurs if I have more than 2 album lists. It takes some time to open a fragment. </p>
  
  <p>Another thing is when I try to scroll (horizontally), sometimes it stops for a short moment, which makes bad user experience.</p>
  
  <p>What I am trying to say is that I have seen similar views and they work quickly and with no lags. Is it possible somehow to optimize it? Or is it possible so that the fragment opens straight away and then the lists load afterwards (kind of lazyload).</p>
  
  <p>LISTVIEW ITEM:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:background="#ccffffff"
      android:padding="10dp" &gt;
  
          &lt;TextView
              android:id="@+id/album_list_item_number"
              android:layout_width="30dp"
              android:layout_height="wrap_content"
              android:text=""
              android:gravity="center|center_vertical"
              android:layout_gravity="center|center_vertical"
              android:textColor="#333333"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  
  
  
  
          &lt;TextView
              android:id="@+id/album_list_item_title"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text=""
              android:layout_weight="1"
              android:gravity="left|center_vertical"
              android:layout_gravity="left|center_vertical"
              android:textColor="#333333"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;TextView
              android:id="@+id/album_list_item_time"
              android:layout_width="90dp"
              android:layout_height="wrap_content"
              android:text=""
              android:gravity="center|center_vertical"
              android:layout_gravity="center|center_vertical"
              android:textColor="#333333"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>POPULATING THE LIST AND ADDING VIEW TO THE HORIZONTAL SLIDER:</p>
  
  <pre><code>    View albumView = inflater.inflate(R.layout.artist_album_col, container, false);
      //setting cover
      ImageView albumCover = (ImageView) albumView.findViewById(R.id.artistAlbumCover);
      albumCover.setImageDrawable(getResources().getDrawable(R.drawable.albumcover)); //cover
  
      ListView albumList = (ListView) albumView.findViewById(R.id.artistSongList);
  
  
      // create the grid item mapping
      String[] from = new String[] {"num", "title", "time"};
      int[] to = new int[] { R.id.album_list_item_number, R.id.album_list_item_title, R.id.album_list_item_time};
  
      // prepare the list of all records
      List&lt;HashMap&lt;String, String&gt;&gt; fillMaps = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      for(int i = 0; i &lt; 24; i++){
          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          map.put("num", "" + i);
          map.put("title", "title title title title title title title title title " + i);
          map.put("time", "time " + i);
          fillMaps.add(map);
      }
  
      // fill in the grid_item layout
      SimpleAdapter adapter = new SimpleAdapter(mContext, fillMaps, R.layout.album_list_item, from, to);
      albumList.setAdapter(adapter);
  
      albumContainer.addView(albumView);
  </code></pre>