title: Android ListView getting changed when resumed
body: <p>I'm using this in onCreate.</p>
  
  <pre class="lang-java prettyprint-override"><code>    /************* Create Custom Adapter on Thread ************/
  
      adapter=new CustomAdapter(CustomListView, CustomListViewValuesArr,res);
      runOnUiThread(new Runnable() {
          public void run() {
              adapter.notifyDataSetChanged();
              list.setAdapter(adapter);
          }
  </code></pre>
  
  <p>This is my Asynctask class,</p>
  
  <pre class="lang-java prettyprint-override"><code>class Asyntax extends AsyncTask&lt;String, Integer, String&gt;
  {
      LoadingDialog lDialog=new LoadingDialog(MainActivity.this);
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          lDialog.show();
  
      }
      @Override
      protected String doInBackground(String... params) {
          try {
              setListData();
          } catch (JSONException e) {
              e.printStackTrace();
          }
          adRequest = new AdRequest.Builder().build();
          return null;
      }
      @Override
      protected void onPostExecute(String st) {
          super.onPostExecute(st);
          lDialog.dismiss();
          list.setVisibility(View.VISIBLE);
          mAdView.loadAd(adRequest);
  
          AdListener googleAdListener = new AdListener() {
              @Override
              public void onAdLoaded() {
                  super.onAdLoaded();
                  try {
                      addMob.setVisibility(View.VISIBLE);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          };
          mAdView.setAdListener(googleAdListener);
      }
  }
  </code></pre>
  
  <p>The method setListData takes value from json each time the activity is called. If I change the json data(by performing task in another activities, trying to make a game) and hit home button to pause it, when I resume the screen only one row is shown in the list(the one having data changed). Please tell me where might have been I wrong?</p>