title: android -The content of the adapter has changed but ListView did not receive a notification
body: <p>I get this error :
  java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131034188, class android.widget.ListView) with Adapter(class .MainActivity$ListAdapter)]</p>
  
  <p>This is what I do , I run a AsyncTask and get json data , then , onPostExecute, I call ListAdapter that makes the data to listview .</p>
  
  <pre><code>@Override
          protected Void doInBackground(Void... arg0) {
              Spots_tab1_json sh = new Spots_tab1_json();
              String jsonStr = sh.makeServiceCall(url + page, Spots_tab1_json.GET);
  
              if (jsonStr != null) {
  JSONObject jsonObj = new JSONObject(jsonStr);
                      contacts = jsonObj.getJSONArray(TAG_CONTACTS);
  for (int i = 0; i &lt; contacts.length(); i++) {
                          JSONObject c = contacts.getJSONObject(i);
                          String onvan = new String(c.getString("onvan").getBytes("ISO-8859-1"), "UTF-8");
                          String id = new String(c.getString("id").getBytes("ISO-8859-1"), "UTF-8");
                          String dates = new String(c.getString("dates").getBytes("ISO-8859-1"), "UTF-8");
                          String price = new String(c.getString("gheymat").getBytes("ISO-8859-1"), "UTF-8");
                          HashMap&lt;String, String&gt; contact = new HashMap&lt;String, String&gt;();
                          contact.put("onvan", onvan);
                          contact.put("img", new String(c.getString("img").getBytes("ISO-8859-1"), "UTF-8"));
                          contactList.add(contact);
                      }
  }
  }
  } 
  
      @Override
      protected void onPostExecute(Void result) {
          super.onPostExecute(result);
              if (!isCancelled() &amp;&amp; goterr == false) {
              final ListAdapter ladap=new ListAdapter(MainActivity.this, contactList);
              lv.setAdapter(ladap);
              runOnUiThread(new Runnable() {
                  public void run() {
                      ladap.notifyDataSetChanged();
                  }});
          }
      }
  </code></pre>
  
  <p>and after that, my listView is built. I've tested it on several different devices , non of them had any problem but some users told me and I logged and see this error. </p>
  
  <p>What should I do to solve it ? what is wrong ? </p>
  
  <p>thanks you</p>