title: No load data anymore except refresh action
body: <p>I couldn't find a solution to my problem on the search engine, So i decided to ask here.</p>
  
  <p>I have navigation tab with 3 fragments <code>fragmentA, fragmentB, fragmentC</code>. Each fragment load data from parsed data. i have opened fragment a and load data on listview, then i want to change to fragment b, and load the data too. but when i want to go back to fragmentA the fragment loads the data again.</p>
  
  <p>I want my fragment are saving the loaded data before and when i refresh the fragment, the fragment load new data. An example app like a twitter or facebook. What i have to do? thanks for reading</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
  
      View Vi = inflater.inflate(R.layout.list_kuliah, container, false);
  
      //Hashmap for ListView
      contactList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      progress = (LinearLayout) Vi.findViewById(R.id.linlaHeaderProgress);
  
      ListView lv = (ListView) Vi.findViewById(R.id.list1);
  
      // Listview on item click listener
      lv.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                  int position, long id) {
              // getting values from selected ListItem
              String name = ((TextView) view.findViewById(R.id.title))
                      .getText().toString();
              String email = ((TextView) view.findViewById(R.id.publisher))
                      .getText().toString();
              String address = ((TextView) view.findViewById(R.id.description))
                      .getText().toString();
              //String thumb_url = ((ImageView))
  
              // Starting single contact activity
              Intent in = new Intent(getActivity() ,SingleKuliahAct.class);
              in.putExtra(TAG_NAME, name);
              in.putExtra(TAG_EMAIL, email);
              in.putExtra(TAG_ADDRESS, address);
              startActivity(in);
              getActivity().overridePendingTransition( R.anim.left1, R.anim.left2 );
          }
      });
      new MyAsyncTask().execute();
      return Vi;
  }
  
  
  private class MyAsyncTask extends AsyncTask&lt;Void, Void, Void&gt; { 
  
  @Override
  protected void onPreExecute() {
      super.onPreExecute();
      progress.setVisibility(View.VISIBLE);   
  }
  @Override
  protected Void doInBackground(Void... args0) {
  
      // Creating service handler class instance
      ServiceHandler sh = new ServiceHandler();
  
      //getting JSON string from URL
      String jsonStr = sh.makeServiceCall(url_contacts, ServiceHandler.GET);
  
      Log.d("Response: ", "&gt; " + jsonStr);
  
      if (jsonStr != null) {
          try {
              JSONObject jsonObj = new JSONObject(jsonStr);
  
              // Getting JSON Array node
              contacts = jsonObj.getJSONArray(TAG_CONTACTS);
  
              // looping through All Contacts
              for (int i = 0; i &lt; contacts.length(); i++) {
                  JSONObject c = contacts.getJSONObject(i);
  
                  String id = c.getString(TAG_ID);
                  String name = c.getString(TAG_NAME);
                  String email = c.getString(TAG_EMAIL);
                  String address = c.getString(TAG_ADDRESS);
  
                  // tmp hashmap for single contact
                  HashMap&lt;String, String&gt; contact = new HashMap&lt;String, String&gt;();
  
                  // adding each child node to HashMap key =&gt; value
                  contact.put(TAG_ID, id);
                  contact.put(TAG_NAME, name);
                  contact.put(TAG_EMAIL, email);
                  contact.put(TAG_ADDRESS, address);
  
                  // adding contact to contact list
                  contactList.add(contact);
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
      } else {
          Log.e("ServiceHandler", "Couldn't get any data from the url");
      }
  
      return null;
      }
  
  @Override
  protected void onPostExecute(Void result) {
      super.onPostExecute(result);
      // Dismiss the progress dialog
      /**
       * Updating parsed JSON data into ListView
       * */
      /*ListAdapter adapter = new SimpleAdapter(
              getActivity(), contactList,
              R.layout.list_kuliah_item, new String[] { TAG_NAME, TAG_EMAIL, TAG_ADDRESS}, new int[] { R.id.title,
                      R.id.publisher, R.id.description });
  
      ListView mView = (ListView) 
              getView().findViewById(R.id.list1);    
      mView.setAdapter(adapter);*/
  
      KuliahAdapter adapter;
      ListView List = (ListView) getView().findViewById(R.id.list1);
      adapter = new KuliahAdapter(getActivity(), contactList);
      List.setAdapter(adapter);
  
      progress.setVisibility(View.GONE);
  }
  </code></pre>
  
  <p>above is my code on fragment kuliah (fragment A), and i have adapter for each fragment</p>
  
  <pre><code>public class KuliahAdapter extends BaseAdapter {
  
  private Activity activity;
  private ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
  private static LayoutInflater inflater=null;
  public ImageLoader imageLoader; 
  
  public KuliahAdapter(Activity a, ArrayList&lt;HashMap&lt;String, String&gt;&gt; d) {
      activity = a;
      data=d;
      inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      imageLoader = new ImageLoader(activity.getApplicationContext());
  }
  
  public int getCount() {
      return data.size();
  }
  
  public Object getItem(int position) {
      return position;
  }
  
  public long getItemId(int position) {
      return position;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
      View vi=convertView;
      if(convertView==null)
          vi = inflater.inflate(R.layout.list_kuliah_item, null);
  
      TextView title = (TextView)vi.findViewById(R.id.title); // title
      TextView artist = (TextView)vi.findViewById(R.id.publisher); // artist name
      TextView duration = (TextView)vi.findViewById(R.id.description); // duration
      //TextView countcomment = (TextView)vi.findViewById(R.id.countcomment); // duration
      //TextView countlikes = (TextView)vi.findViewById(R.id.countlikes); // duration
      //TextView created = (TextView)vi.findViewById(R.id.created); // created
      //ImageView thumb_image=(ImageView)vi.findViewById(R.id.image); // default image
  
      HashMap&lt;String, String&gt; contactList = new HashMap&lt;String, String&gt;();
      contactList = data.get(position);
  
      // Setting all values in listview
      title.setText(contactList.get(KuliahFragment.TAG_NAME));
      artist.setText(contactList.get(KuliahFragment.TAG_EMAIL));
      duration.setText(contactList.get(KuliahFragment.TAG_ADDRESS));
      //countcomment.setText(courses.get(KuliahFragment.TAG_COUNTCOMMENT));
      //countlikes.setText(courses.get(KuliahFragment.TAG_COUNTLIKES));
      //created.setText(courses.get(KuliahFragment.TAG_CREATED));
      //imageLoader.DisplayImage(courses.get(KuliahFragment.TAG_IMAGE), thumb_image);
      return vi;
  }
  </code></pre>
  
  <p>}</p>