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 4242110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:23:54+00:00 2026-05-21T03:23:54+00:00

First off, I have looked around the site and could not find a solution

  • 0

First off, I have looked around the site and could not find a solution to my question, other than “hide the ListView”. This is not a viable solution in my case!

So, the problem:
I have created my own “EndlessAdapter” which allows me to populate the ArrayList<> backing the ListView with more data as the user scrolls to the bottom of the List. This all works perfectly, except for when the user selects a Row whilst the List is updating, or changes orientation whilst the List is updating (I suppose it could be any UI interactions).

I have wrapped my mAdapter.notifyDatasetChanged() method in a try catch, but I can never seem to catch this IllegalStateException, so I do not know where is it occurring!

Is there a way, whilst the Adapter is updating the ListView, that I can block the user from interacting with the application until its finished? The long part of the EndlessAdapter process is the downloading of the new data. Updating the ListView is a fast process imo.

I really need to get this issue sorted. Id rather not post up source code, but if need be I can try and post up the vitals? Otherwise I would be very appreciative if someone with experience in this could have a chat over Email or IM?

Here is the stack trace:

04-05 21:11:35.363: ERROR/AndroidRuntime(25707): 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(16908298, class android.widget.ListView) with Adapter(class com.mimminito.heatdroid.view.DealsView$DealAdapter)

Here is a link to a sample of my code:
http://pastebin.com/wfmWSGwQ

I create the Adapter in the onCreate(). I then assign the Adapter to the ListView once the XML has been parsed. In the same method I call the updateList() method. This gets the data that has been downloaded, and then notifies the mAdapter that its data has been changed (all run on the UI thread)

Thanks for your time

Adam

  • 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-21T03:23:55+00:00Added an answer on May 21, 2026 at 3:23 am

    You’re doing both the adding to the list and the notify in the UI-thread as it says? This is the only way to guarantee that the list is not used by the UI and your other threads at the same time.

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

Sidebar

Related Questions

I have looked around for a solution to this problem, but it's so wonky
First off, I've looked at several other questions about optimizing sql queries, but I'm
First off I should say that I don't have any experience in working with
First off thanks to all the users who have made my android developing adventure
First off - apologies for the poor title, I have no idea how to
First off, I am using Windows XP. I have multiple hard drives and it
First off, I'm aware this is a bad practice and I have answered many
First off, let me clarify the platforms we are using. We have an ASP.NET
First off, I'm new to Java, so please be gentle. I have a JFrame
I have two questions, actaully... First off, Why cant I do this: List<Object> object

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.