Questions tagged [notifydatasetchanged]

Android Adapter notifyDataSetChanged() method notifies observers that the underlying data has changed

Android Adapter notifyDataSetChanged() method notifies observers attached to the adapter that the underlying data has changed and any Views reflecting the data should be refreshed.

Use this tag for example with questions related to problems refreshing AdapterViews such as ListView. Include also the main subject tag .

595 questions
4
votes
0 answers

IllegalStateException : PagerAdapter changed the adapter's contents without calling PagerAdapter notifyDataSetChanged

When should notifyDataSetChaned be called? I am using FragmentStatePagerAdapter. I have one item in my dataset. I add a new item to my dataset. But I do not make any changes to viewPager. No touch event or any user generated event is passed. I call…
4
votes
0 answers

RecyclerView notifyDataSetChanged does not call the onBindViewHolder to update the data

On data change we are calling notifyDataSetChanged to update the recyclerview data to the latest. Some scenario is working properly, but In some scenario is not calling the onBindViewHolder to update the data. The notifyDataSetChanged is not calling…
4
votes
1 answer

Endless RecyclerView with Asynctask

I have an app which has endless recyclerView (when certain offset to the end of list is reached, I call interface method from recyclerView adapter). RecyclerView Adapter public SearchResultAdapter(ArrayList suggestions) { …
4
votes
1 answer

Update and control multiple CountDownTimer in RecyclerView (pause, resume, delete)

I've implemented to my Android app multiple countdown timers with Service. CountDownTimer is running with service, thus data to fragment is being passed with BroadcastReceiver. I would like to add each timer as a separate item to the RecyclerView…
4
votes
2 answers

Want to Implement notifyDataSetChanged or autorefresh to my RecyclerView but its not working

I Want to Implement notifyDataSetChanged or auto refresh to my RecyclerView but its not working , i have tried so many methods to work this out but unfortunately all methods end up with crashes , some didn't work. I'm new to development so, plz…
4
votes
2 answers

Can't update RecyclerView from my model Class?

I am working on a RecyclerView which must be Draggable & swipeable. Everything works perfect. The Data is getting Fetched in one class called ExerciseDataProvider & the RV code is another Fragment RecyclerListViewFragment. The problem is that i…
Arulnadhan
  • 923
  • 4
  • 17
  • 46
4
votes
3 answers

RecyclerView does not update after add data

I'm migrating from ListView to RecyclerView, but after entering some data in SQLite, my list is not updated using notifyDataSetChanged (); so I always have to call the setAdapter () method; I have simplified my code to post here. can anyone help me…
F4bioo
  • 179
  • 1
  • 5
  • 11
4
votes
2 answers

Android add/replace Items within RecyclerView

I know there are lots of threads already on this topic, but none of the given solutions worked for me so far. I'm trying to add or update an item of a RecyclerView. Here's my code so far: MainActivity private MyListItemAdapter mAdapter; private…
4
votes
1 answer

How to use ListView, ArrayList, ArrayAdapter and notifyDataSetChanged together with a runnable, and a message Handler in the main thread

I worked thru 6 other SO question threads plus some blog posts with the same error mesage, all to no avail. I am loading a files directory into an ArrayList and then into a ListView using an ArrayAdapter. The code actually works - the directory…
4
votes
0 answers

recyclerview notifyDatasetChanged not work

I have a list using recycler view. The list has 3 different types of items header (nearby xxx , in area xxx, etc) actual item (black rectangle) footer (loadmore) -> footer only show if actual item in one header more than 3 when loadmore clicked I…
aiwiguna
  • 2,852
  • 2
  • 15
  • 26
4
votes
4 answers

How to refresh a ListView from a BroadcastReceiver?

If I call notifyDataSetChanged() on the custom adapter associated to my ListView, all the views should refresh themself (getView() will be called). Now I have a BroadcastReceiver that is listening to an event. When the event fires, the ListView must…
Angelo
  • 907
  • 3
  • 16
  • 33
4
votes
2 answers

Android ParseQueryAdapter notifyDataSetChanged does not work

Using latest Parse library v1.5.1 Thanks to the update now I can do: ParseQueryAdapter mAdapter = new ParseQueryAdapter(MainActivity.this, new ParseQueryAdapter.QueryFactory() { @Override public…
4
votes
2 answers

Android: Detect if a ListView has the scrollbar (after setting new data)

I have an ArrayAdapter linked to a ListView. mListView.setAdapter(mArrayAdapter); Whenever I reset the ArrayList data to the ArrayAdapter: mArrayAdapter.clear(); mArrayAdapter.addAll(mArrayList); mArrayAdapter.notifyDataSetChanged() the ListView…
4
votes
1 answer

Refresh ExpandableListView from within my adapter

I found only one similiar question and it didn't help me. I hope you can help me, because I'm stuck. This is my custom adapter (only the relevant part): MyExpandableListAdapter: public class MyExpandableListAdapter extends BaseExpandableListAdapter…
Aksiom
  • 1,565
  • 4
  • 25
  • 39
3
votes
1 answer

Recyclerview not updating the data list

I'm using recyclerview to display data from sqlite database using cursor , when I delete an item from database the item gets deleted but my recycler view doesn't refresh. I have to go back to my main activity and then the data gets refreshed. I have…