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
3
votes
1 answer

RecyclerView .addTextChangedListener gives multiple positions

I'm trying to create a RecyclerView that contains an EditText in each row. Once the text is changed i'd like it to show the position with println. It runs fine until i run .notifyDataSetChanged() in my main method. After that it prints multiple…
3
votes
3 answers

Inconsistency detected error after adding notifyDataSetChanged()

Im making an activity log and i have a problem where i can't scroll down an Inconsistency error keeps popping up. I have added the notifyDataSetChanged method as well but i still have no luck in fixing the error. Here is the error that i am…
3
votes
1 answer

Calling notifyItemChanged() on a RecyclerView.Adapter from another class

I have a RecyclerView in AdapterActivity. After clicking on any of its items, I update that item using my AlertDialogShow#UpdateStudent() method. My problem is that I can not refresh the Adapter inside the UpdateStudent() method using…
user9512415
3
votes
1 answer

Correct approach on using RecyclerView?

My task is to develop a list of different type of questions, a survey. It could include types like Integer-Answer-Question, Long-Text-Answer-Question, and so on. Why is it needed to be a list? Because for the people using the app is way better to…
3
votes
1 answer

RecyclerView notifyItemChanged(position) crashes the app and no animations with notifyDataSetChanged()

So I have a RecyclerView and in every xml that i pull into it there is a checkbox that when pressed removes that specific item from the RecyclerView. That's what I was trying to do at least. And as I understand for it to work i need to use…
Sajev
  • 45
  • 2
  • 9
3
votes
0 answers

notifyDataSetChanged() issue custom ArrayAdapter

I have a custom horizontal grid implementation using Android-DraggableGridViewPager My flow is as follows 1.I set an initial adapter with an empty list. 2.I make a network call and update the same list and call notifyDataSetChanged() on that…
usr30911
  • 2,731
  • 7
  • 26
  • 56
3
votes
1 answer

notifyDatasetChanged() not working after sorting RecyclerView

My RecyclerView contains check marks in front of movies which are seen. I am using notifyDatasetChanged() after sorting my RecyclerView. After clicking the menu options, even though items are changing, the check marks are not changing and stay in…
3
votes
2 answers

Android: How to change ListView item's value in Fragment?

I created a Fragment that has a ListView with several items. According to my plan, when I click one of the items on the ListView, I move to another Fragment, get data from them, replace the original data with the new one and update the ListView. In…
3
votes
1 answer

Refreshing values of recyclerview adapter from another adapter

I have to two data sets with different adapters inside a single activity and I want to use notifyDataSetChanged() however its not working for the other adapter. So inside my adapterFirst class I have LongCLickListener which is using…
BXUMZSE
  • 211
  • 2
  • 11
3
votes
0 answers

recyclerview notifydatasetchanged change current view position

i have recyclerview in this when i click on one element of row i am changing model value and calling notifydatasetchanged. but problem is ,i have 20 row and when user visible rows are 15-20 and user clicks on 20th row and i call notifydatasetchanged…
andro
  • 1,007
  • 1
  • 14
  • 32
3
votes
3 answers

How to make specified item not update when notifyDataSetChanged in RecyclerView

I have a item in RecyclerView which does not need to be updated when I call notifyDataSetChanged. But I didn't find any methods to make the specified item avoid updated. Is it possible to do this ? I need to do this because the item is a WebView,…
L. Swifter
  • 3,179
  • 28
  • 52
3
votes
1 answer

notifyDataSetChanged() doesn't work with my RecyclerView.Adapter when it's called from onActivityResult()

When onActivityResult() is called after a user returns to the original activity I update the data for the RecyclerView and call notifyDataSetChanged() but onBindViewHolder() is not being called and the RecyclerView does not update. If I run the…
3
votes
2 answers

notifyDatasetChanged in RecyclerView not working from Fragment

I'm calling notifyDataSetChanged method on my adapter after a db change, but this method not updating the view. myclass fragment on tap on cardview open a external activity i use the interface for receive the event onActivityResult (this fire…
BruceOverflow
  • 556
  • 9
  • 25
3
votes
1 answer

adapter.notifyDataSetChanged() in fragment

I want use ListView and GridView in my Fragment but I get an error in this line: adapter.notifyDataSetChanged(); My Error is NullpointException and I'm using library support version 4. public class Gallery_fragment extends FragmentActivity { …
3
votes
1 answer

update listview when click favorites button

I want when click the button btn in class ListViewAdapter, updates my sqlite and changes the background of btn , When MainActivity start and the button is clicked first,is correctly. but when I scroll the list, the background of btn returns to its…