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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:20:09+00:00 2026-06-14T12:20:09+00:00

I am having a problem where when I call the adapter.notifyDataSetChange() to refresh the

  • 0

I am having a problem where when I call the adapter.notifyDataSetChange() to refresh the listActifity from the onResume() function, it doesn’t seem to be working from any other functions from that activity afterwards.

I want the list(view) to refresh when the user clicks the back button(while on another screen) and returns to the window with the list.
One of the things I noticed is that the notifyDataSetChange() works(from other functions) when I change one of the objects from the array list but not when I want to add or delete an object from the ArrayList. This has been working so far for me, but I would prefer not to have to requery the list every time.

@Override  
        protected void onResume() {  
        lightWeightDAO.open(); //db connection  
        adapter.clear();  
        buckets = lightWeightDAO.getExerciseBucketsByWorkoutId(workout.getId());   
        adapter.addAll(buckets);  
        adapter.notifyDataSetChanged();  
        super.onResume();      
    }

When I remove the notifyDataSetChange() from the onResume(), everything seems to work(just calling a simple notifyDataSetChange() after changing the arraylist).

Any idea why this is not working?

  • 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-06-14T12:20:11+00:00Added an answer on June 14, 2026 at 12:20 pm

    By using:

    buckets = lightWeightDAO.getExerciseBucketsByWorkoutId(workout.getId());   
    adapter.addAll(buckets);  
    

    You have only added the contents of this new buckets to the adapter, you didn’t bind the adapter to buckets. So this:

    buckets.add(string);
    adapter.notifyDataSetChanged();
    

    has no affect on the data inside the adapter. Also like I mentioned above in the comments, you can add to the adapter directly and it will call notifyDataSetChanged() for you. So simply replace everywhere you use the two lines above with:

    adapter.add(string);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problem closing current form when I call some other form from
im having problem with getting value of a variable from the ajax-call function getRequest
I am having a problem with a soap call I'm trying to do from
I'm having a problem with jqGrid. I need to call a function when a
I'm having a problem with the call to SQLGetDiagRec. It works fine in ascii
I'm having a problem with my ajax call. I'm submitting some info via php
I am having a problem with the service.getDistanceMatrix call. <html> <head> <script type=text/javascript src=http://maps.google.com/maps/api/js?sensor=false>
Having a problem with NSURLConnection, if I create a NSURLConnection and call [connection connectionWithRequest]
i having a problem with a global method called returnDayNumber. If i call the
I am having an interesting problem with using pinvoke in C# to call _snwprintf.

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.