Android ListView update after asynctask -


There is a problem in my adapter for my list view, I do not know where to inform me if the DataAttetChanged code is always An error is occurring when I run this code in the logcat:

  java.lang.IllegalStateException: The content of the adapter has changed, but ListView did not receive the notification. Make sure that your adapter The content has not been modified from the background thread, but only from the UI thread. Make sure that your adapter call data update () changes its contents when it changes [ListView (2131165276, class android.widget.ListView)]   

my asynctask:

  Class UpdateData AsyncTask Expands & lt; Zero, zero, JSONArray & gt; {String result = ""; JSONArray jArray = null; @Override Secure Zero at PostXextech (Jason Array results) {super.onPostExecute (results); adapter.addAll (deptList); Adapter.notifyDataSetChanged (); } @ Override Protected Zero at PreExecute () {super.onPreExecute (); } @ Override protected JSONArray doInBackground (zero ... arg0) {.... try {JSONArray array = new JSONArray (results); (Int i = 0; i & lt; arrays.lamban (); i ++) {JSONObject j = array.getJSONObject (i); EventCalendarTrastingsD = new eventCalendarStressing (); d.name = j.optString ("name", ""); d.kategorie = j.optString ("Art", ""); deptList.add (d); }} Hold (JasonXEpisode E) {Log.e ("Log_tag", "No Connection" + E.Streatin ()); }} Return Jarre; }    

It goes to PostExecute () on Calling it in the doInBackground () , executed on the UI thread, it will result in that exception.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -