Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:01:52+00:00 2026-05-23T09:01:52+00:00

This was discussed earlier here Android, ListView IllegalStateException: "The content of the adapter has

  • 0

This was discussed earlier here Android, ListView IllegalStateException: "The content of the adapter has changed but ListView did not receive a notification" but I still have the problem.
I’ve got Service, which dowloads data from web, saves it do db and fires intent when it’s completed. My Activity has ListView and BroadCast receiver:

private class NewsUpdateReceiver extends BroadcastReceiver{

        @Override
        public void onReceive(Context context, Intent intent) {

            mNotificationManager.cancel(NewsService.NOTIFICATION_ID);

            loadNewsFromDB();
        }
    }

 private void loadNewsFromDB(){
        mList.clear();
        ContentResolver cr = getContentResolver();

        Cursor cursor = cr.query(MeidahonProvider.CONTENT_URI, null, null, null, null);

        if(cursor.moveToFirst()){
            do{
                String title = cursor.getString(MeidahonProvider.TITLE_COLUMN);
                String description = cursor.getString(MeidahonProvider.DESCRIPTION_COLUMN);
                String link = cursor.getString(MeidahonProvider.LINK_COLUMN);
                long datems = cursor.getLong(MeidahonProvider.DATE_COLUMN);
                Date date=new Date(datems);
                NewsItem item = new NewsItem(title, description, link, date);
                mList.add(item);
                mAdapter.notifyDataSetChanged();
            }while(cursor.moveToNext());
        }
        cursor.close();
    }

Every time when item is add to ArrayList, I call mAdapter.notifyDataSetChanged(); but still have exception. How can I solve the problem?

UPD LOG

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(2131296334, class android.widget.ListView) with Adapter(class com.transportoid.Tracks.TrackListAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1432)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:2062)
at android.widget.ListView.onTouchEvent(ListView.java:3234)
at android.view.View.dispatchTouchEvent(View.java:3709)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:01:53+00:00Added an answer on May 23, 2026 at 9:01 am

    First off, unless you “need” for your various bounded components to be made aware of the change in the adapter content on every iteration I would only call adapter.notifyDataSetChanged() after you’ve completed all the additions.

    Secondly, can you provide the Exception and StackTrace?

    Third, what Thread is this code being invoked with (the main GUI dispatching thread or a background)?


    Thanks Migher for the updated Logcat. Do me a favor to help clarify a point: can you run a quick test to see what happens when you manually enter the same data values … do it from a menu selection or a button click event (so we’ll know it’s on the GUI thread)? Getting the same error?

    Also worth pointing out is give a SimpleCursorAdapter a try instead of the regular Adapter you’re currently using. As I’m not able to run this through my debugger this might be just a simpler fix than going back and forth with “asynchronous tech support” suggestions, as I’m sure you’d like this fixed sooner rather than later.

    Let me know how either of these work – thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this has been discussed many times, but I am not sure I
I know this has be discussed over and over again here, but none of
This has been discussed in a few threads - but none gave any real
I know this has been discussed a number of times but I've been through
I know this topic has been discussed and killed over and over again, but
(Not sure is this has been discussed before ...) When building SQL for category
I'm sure this has been discussed many times before, but for whatever reason I
ASP.NET MVC has been discussed on this forum a few times. I'm about to
I don't know if this has been discussed. Let's say you are in a
This question has been discussed in two blog posts ( http://dow.ngra.de/2008/10/27/when-systemcurrenttimemillis-is-too-slow/ , http://dow.ngra.de/2008/10/28/what-do-we-really-know-about-non-blocking-concurrency-in-java/ ),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.