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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:52:59+00:00 2026-05-27T18:52:59+00:00

In my Activity there is a TabView with 3 Tabs , each tab has

  • 0

In my Activity there is a TabView with 3 Tabs , each tab has a ListView and a Button.
When i navigate the tabs using the D-Pad on the emulator there is no problem, but when i use the scroll-wheel(mouse) to navigate the view and then click in the View there is a ForceClose. I think its got something to do with “touchmodechange” but not sure how to handle this. Really appreciate any help…

12-23 19:14:25.352: ERROR/ActivityThread(116): Failed to find provider info for android.server.checkin
12-23 19:18:09.184: ERROR/AndroidRuntime(226): Uncaught handler: thread main exiting due to uncaught exception
12-23 19:18:09.224: ERROR/AndroidRuntime(226): 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.
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.widget.ListView.layoutChildren(ListView.java:1428)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.widget.AbsListView.onTouchModeChanged(AbsListView.java:1888)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.view.ViewTreeObserver.dispatchOnTouchModeChanged(ViewTreeObserver.java:591)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.view.ViewRoot.ensureTouchModeLocally(ViewRoot.java:1877)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.view.ViewRoot.ensureTouchMode(ViewRoot.java:1861)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1652)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.os.Looper.loop(Looper.java:123)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at android.app.ActivityThread.main(ActivityThread.java:4203)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at java.lang.reflect.Method.invokeNative(Native Method)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at java.lang.reflect.Method.invoke(Method.java:521)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
12-23 19:18:09.224: ERROR/AndroidRuntime(226):     at dalvik.system.NativeStart.main(Native Method)



private void fillData(int tab)
    {
        Cursor cursor;
        Long millis;
        String tempstr;
        //query table and obtain cursor 
        if(tab==0)
            cursor=dbAdapter.getAllRemindersCursor();
        else if(tab==1)
            cursor=dbAdapter.getAutoRemindersCursors();
        else if(tab==2) 
            cursor=dbAdapter.getUserRemindersCursors();
        else
            cursor=dbAdapter.getAllRemindersCursor();

        results.clear();

        //populate the ArrayList using the cursor
        if(cursor!=null)
        {
            if(cursor.moveToFirst())
            {
                Log.d("Msg","Cursor at first item");
                Log.d("Msg",cursor.getCount()+" items in cursor");
                do
                {
                    millis=cursor.getLong(1);
                    tempstr=cursor.getString(2);
                    tempstr=" "+tempstr+"\n"+" "+dtf.format(millis);
                    results.add(tempstr);
                    category.add(cursor.getInt(4));
                    Log.d("Msg","message and type items added");
                }
                while(cursor.moveToNext());
            }
        }
        else
        {
            Log.d("Msg","Cursor is empty");
        }

        if(tab==0)
            lv1.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results));
        else if(tab==1)
            lv2.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results));
        else if(tab==2)
            lv3.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results));
        else
            lv1.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results));
    }

This method is called every time onTabChangedListener is triggered. Other wise there is
nothing much else at present in this Activity.

  • 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-27T18:52:59+00:00Added an answer on May 27, 2026 at 6:52 pm

    The problem is that you are sharing the same results List for all of your Adapters. This list is directly referenced inside the adapter, so when you switch a tab you’re updating the adapter on all of them (this is why you get an IllegalStateException). Instead of reusing the results variable, simply create a new one inside your filldata method, there’s no need (that I can see from the code above) to use the same one. I believe you could have also just used CursorAdapters and not bothered the intermediate List.

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

Sidebar

Related Questions

An Activity occurs at a location on a specific date, but each activity may
In my activity page ,there is a layout which contains one listview at top(listview1),below
I have designed an activity in which there is a listView. I want that
Ok here is my problem: I'm going to start new activity when there isn't
I am using tabview in my application, in which Home is default tab selected
In My Activity there are more then one ListView. See the XML Layout of
Is there any way to view the activity log for the integrate SourceSafe inside
Is there a way to vizualise the activity stack, at some moment during debug,
is there a way to create a task/activity report (say a weekly report) off
Is there a way to find out if an activity is bound to a

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.