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
2 answers

Android ListView Adapter error calling notifyDataSetChanged, Android bug?

In the app I've been working on, I have a custom class DeviceListAdapter extending BaseAdapter which gets passed to my ListView. In my DeviceListAdapter class, I keep my own ArrayList which I use to generate the list's views with View…
3
votes
2 answers

notifyDataSetChanged() causes IndexOutOfBoundsException

Here's a shortened version of my code. public class MainActivity extends ActionBarActivity { private ArrayList entry = new ArrayList(); private String[] entryString = new String[11]; private ArrayAdapter aa; private ListView…
3
votes
0 answers

notifydatasetchange to expandableListView android

I am using ExpandableListView to show my data. but when I perform some operation in ChildView of expandableListView that time I want to update my ExpandableListView as per my new data. I have tried expandableListview.notifyDataSetChanged(); at that…
2
votes
2 answers

Android recyclerview shows more values after data change

I am trying to edit an item in a recyclerview which shows some data from Firebase. But after editing the data set is not changed. It shows previous as well as the new updated items, until the activity is reloaded. The screenshots are given at the…
2
votes
0 answers

How to remove the "blinking/flikering effect" from ListView

My listener which automatically updates the listview, once the database change: useradapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1, userArrayList); myUserListView.setAdapter(useradapter); Disposable d= new…
2
votes
1 answer

RecyclerView gets not notified about visual changes when using the recyclerview-selection library

I have implemented the recyclerview-selection library successfully. Now I am trying to make a "select all items" button with the method SelectionTracker.setItemsSelected(keys: Iterable, selected: boolean). So far so good. My problem is now that…
2
votes
3 answers

Android - RecyclerView - edittext notifyItemChanged keep focus and continue typing

I have a RecyclerView which has an EditText in its items. For each EditText I have added a textChangeListener. Whenever the user types a character I want to do an input validation and so I can change the item, for example show red border in case of…
2
votes
0 answers

ArrayAdapter won't update after first suggestion with AutoCompleteTextView

I try to use AutoCompleteTextView with ArrayAdapter. everything works correctly before first try to use AutoCompleteTextView. after the first try, just AutoCompleteTextView shows the last selection (and in this case your first try with…
2
votes
2 answers

Update RecyclerView When Adding Comment

I'm making a CommentFragment. I have a RecyclerView to list comments and a Edittext to write comment. However when I add a comment it's sent to server but RecyclerView isn't updated. I use notifydatasetchanged to update. Code: private void…
2
votes
0 answers

How to update just a specific view of listview item?

I have a listview that each items have a progressbar that update every seconds, so I used notifyDataSetChanged() to update each item of list view, in this state every things is OK, But I also have a button on this item of list view that has its…
SadeQ digitALLife
  • 1,403
  • 4
  • 16
  • 22
2
votes
1 answer

onBindViewHolder not called after calling diffResult.dispatchUpdatesTo(this)

I am setting my data to recycler view by this : public void setData(List newNotifications) { DiffUtil.DiffResult diffResult = getDiffBetweenNewAndOldList(newNotifications); diffResult.dispatchUpdatesTo(this); …
2
votes
1 answer

Disable animation in notifyDataSetChanged()

I'm trying to change the visibility of ImageView (Visible/Invisible), depending on the RecyclerView item state (Selected/Not selected), so if the item selected, I want to make ImageView visible, something like the below picture : I wrote the…
2
votes
1 answer

onBindViewHolder() called without payload after notifyItemChanged() with payload

I have notifyDataSetChanged() followed by notifyItemChanged(0, Unit) with payload called for the same adapter, containing, say, 3 items. Each of the calls is made inside view.post(). I expect onBindViewHolder() will be called 4 times: 3 times…
Alexey
  • 2,980
  • 4
  • 30
  • 53
2
votes
1 answer

After Scrolling, Recycler moves to first postion

I face difficulty when working using recyclerview and Gridview. The problem is when my application success load next page (next data), the recyclerview always back to the top. I want the recyclerview start from last index. Example: First-page load…
2
votes
4 answers

Custom Expandable RecyclerView Crashing on notifyItemRangeRemoved and notifyItemRangeInserted

I have created expandable recylerview following is my adapter code public class FoodMenuRecyclerAdapter extends RecyclerView.Adapter { List objects; FoodMenuParentListener foodMenuParentListener; boolean…
amodkanthe
  • 4,345
  • 6
  • 36
  • 77