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

how to set condition in adapter?

I use this to visible some textview public void onBindViewHolder(@NonNull ViewHolder holder, int position) { Post p = posts.get(position); holder.textView1.setText(p.getName()); holder.textView2.setText(p.getFamilyName()); …
-1
votes
1 answer

NotifyDataSetChanged is not working when the field of some items in list is changed in RecyclerView

I have a Model UniqueUserTransModel and a UniqueArrayList. Initially, I have the List and I am passing it to the Adapter. Old List -> pos : 0, name : "user 1", transcount : 10 pos : 1, name : "user 2", transcount : 9 pos : 2, name : "user 3",…
Aman Verma
  • 3,155
  • 7
  • 30
  • 60
-1
votes
1 answer

List refreshed withous notifyDataSetChange?

I have a little question for you. I have an app which displays a list of subjects which could be removed or addedd. During developing I realized that I could add new subject without call notifyDataSetChange, why? Class (ListSubject) which manage…
-1
votes
3 answers

Cannot resolve symbol notifyDatasetChanged

I am working with an application where i get records from my azure database and insert it into an array, and the listview must display my array. My error comes when i try to call the method notifyDatasetChanged, Here is my code: Button…
-1
votes
2 answers

How to change an ImageView, that is part of a list item?

I have a ListView that shows list items (duh). When you click on a list item, another Activity opens. Part of the list item layout is a grey star, an ImageView. When you click on this ImageView, I don't want to open another Activity, but I want to…
-1
votes
2 answers

Why my listview not refresh when I press back button and come back to activity?

I'm tired already with my code. I'm writing chat application. My app consist of two activity. First activity has a listview of wich each row contain a last message which was send for the user while a second activity contain the whole conversation.…
SeaDog
  • 645
  • 1
  • 9
  • 32
-1
votes
1 answer

Refresh data on BaseAdapter

I have a problem with Android Studio. First I copy the BaseAdapter class: public class AdaptadorGaleriaProductos extends BaseAdapter { private List productosArray = new ArrayList(); Context context; int background; private…
ZottoSL
  • 170
  • 1
  • 12
-1
votes
4 answers

notifyDataSetChanged not work in my activity

in my code when delete row of list view list view don't change.i use adapter.notifyDataSetChange() but it not word.this is my code : code make different position of class. CustomList adapter; Integer[] imageId; public String[] _Data2; public int…
amardco
  • 17
  • 1
  • 6
-1
votes
1 answer

Adapter does not refreshing

I want to refresh my adapter in two situation but nothing happend. First I tried called adapter.clear(); adapter.addAll(filteredList); //filtered list is a new list to show on adapter adapter.notifyDataSetChanged(); The second I tried refresh…
Expiredmind
  • 788
  • 1
  • 8
  • 29
-1
votes
1 answer

When I notifydatasetchanged my adapter every second, click events dont work properly

I want to implement custom progressview on base adapter for showing background download progress on list items, every second I check download progress and update my model, then trigger notifydataset to reflect the progress to UI. Since it couses so…
hugerde
  • 919
  • 1
  • 12
  • 27
-1
votes
1 answer

Error: Cannot Resolve method notifyDataSetChanged(); Android

I am trying to implement searchbar in gridview.So for that i am trying to use notifydatasetchanged() in customfilter but it says method cannot be resolved.Here is the code.Thankyou in advance. package com.example.krishna.pokemongopokemons; import…
-1
votes
1 answer

Please suggest me on proper usage of notifyDataSetChanged()

I'm using view pager with swiping tab layouts. And i'm displaying list view of data using custom adapter. And also onclick of list view i have a list view detail activity where I'm displaying data in more detail. In these detail activity i'm…
Rakesh
  • 43
  • 1
  • 1
  • 10
-1
votes
2 answers

BaseAdapter for GridView: getView() not always called on notifyDatasetChanged()

I have a custom BaseAdapter that is used for a GridView. I call notifyDatasetChanged() on it. However, getView() is not called so my UI is not updated. I have debugged this and saw that the underlying data is correct containing the correct enabled…
barq
  • 3,681
  • 4
  • 26
  • 39
-1
votes
2 answers

Listview adding items from otherActivity

I'm trying to fetch the data from the other activity and adding it to the listview which is in my main acitivity ArrayAdapter arrayAdapter; ArrayList fetchList= new ArrayList(); @Override protected void…
coder
  • 13,002
  • 31
  • 112
  • 214
-1
votes
1 answer

ArrayAdapter notifyDataSetChanged not responding

Ok, I do realize there are allot of posts related to context menus and listViews. I have looked at over 20 pages and none have been able to fix my issue. I am able to remove an item from the listView but my application skips over the…
1 2 3
39
40