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

FragmentStatePagerAdapter getCount() is not called

I am using FragmentStatePagerAdapter in my app. My problem is that when I am doing notifyDataSetChanged() it's calling only the getCount() and not the getItem(). the getCount is not returning 0. this is my FragmentStatePagerAdapter: private class…
roiberg
  • 13,629
  • 12
  • 60
  • 91
0
votes
3 answers

Row gets duplicated after delete from ListView

I know there are already a lot of questions pertaining to this same issue. Mine looks a bit weird! I have a custom adapter for ListView where I pass an ArrayList of a Model. I have a Context Menu set for this List where on clicking delete, I need to…
0
votes
1 answer

Android since Kitkat doesn't deliver updates to inner adapter views

We have a ListView with BaseAdapter and each row contains horizontal ListView (just AdapterView). Before KitKat (Android 4.4) expanding some row inside ListView lead it for trigerring getView() for whole ListView and it lead to calling getView() for…
0
votes
1 answer

Cant scrolling during .notifyDataSetChanged()

In following project here is example I'm using with .notifyDataSetChanged(); this method .post(new Runnable(){ to scroll down after adding new item private void addItemsToList() { int randomVal = MIN + (int) (Math.random() * ((MAX -…
NickUnuchek
  • 11,794
  • 12
  • 98
  • 138
0
votes
2 answers

Adding data at the specific position of Listview in android

I have a listview and I have to add two more element in listview. I have to add notifyDataSetChanged() . but not sure how to do it. listView = (ListView) findViewById(R.id.my_listview); myListAdapter = new MyListAdapter (this,…
Subrat
  • 3,928
  • 6
  • 39
  • 48
0
votes
1 answer

BaseExpandableListAdapter notifyDataSetChanged() error

I looked through a lot of information, but have not found the right solution. My code: import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import…
SmallSani
  • 172
  • 4
  • 19
0
votes
2 answers

Trying to filter items in a listview, trough another activity, how to update the listview?

I have looked trough some samples on google/stack and didnt find any good solution for my problem. i got, in the activity where the listview is shown, a filter made(winesCopy is a copy of the wines list): public static List
cc2k
  • 351
  • 1
  • 2
  • 12
0
votes
1 answer

Refresh list with custom adater after delete an item with OnItemLongClickListener

I want to delete items from a list when the user makes a long click on it and refresh the list. When I use this code, it delete the item but don't refresh the list: codeListView.setOnItemLongClickListener (new OnItemLongClickListener() { public…
Laire
  • 1,290
  • 6
  • 22
  • 49
0
votes
2 answers

Refresh Listview not working after dialog box

Refresh not working in Listview; Already looked up many other responses on similar topics but could not solve the problem. listview with order items + a button that opens a dialog box to set the quantity. the database is updated from within dialog…
0
votes
1 answer

Android CardUI Library: Refresh content of card on onResume event of Fragment

I am using CardUILib for one of my projects and I must confess it's awesome but have been stuck at an issue. I want to update all stacked card content on onResume event of Fragment. I am not able to find a method to refresh those content when…
0
votes
2 answers

Adapter notifyDataSetChanged nor working

I used notifyDataSetChanged for adapter but my List didn't updated. Here is part of my code. adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1,userNames); list = (ListView)…
Hayk Nahapetyan
  • 4,452
  • 8
  • 42
  • 61
0
votes
1 answer

Listview is working incorrectly with implementing a load more function

So, I have a listview and getting the data for it from an external database. I would like to have 20 items the first time, then if the user scrolls down it loads another 20 and so on. class ItemAdapter extends BaseAdapter { private…
Jani Bela
  • 1,660
  • 4
  • 27
  • 50
0
votes
1 answer

notifyDataSetChanged() on SimpleExpandableListAdapter not working in broadcastreceiver

I have gone through Android: How to correctly use NotifyDataSetChanged with SimpleExpandableListAdapter?, and have a similar program structure but the list (of access points) appears on creation (first scan) and disappears on the next wifi…
0
votes
2 answers

How can I get notifyDataSetChanged() to start working?

I'm trying to change a spinners values based on the selection of an item in another spinner. The values used to populate both spinners are in an xml file called array. The array file looks something like
0
votes
1 answer

Why isn't my ListView displaying new elements from its source?

I'm getting an app together that basically displays database information nicely. Main activity: public class MainActivity extends FragmentActivity { public static List entryTitles; @Override protected void onCreate(Bundle…
jimmygoska
  • 49
  • 1
  • 4