1

I have a list of students that I display in an adapter that I create in the class MyCustomAdapter.
Here is the class ManageSection where I call the adapter.

3 Answers3

1

You need to delete record from your list which you pass to your custom dapter adapter(i think studentList is your list) and call notifyDataSetChanged() Method.

Edit :

if (stdel == false) 
{
Toast.makeText(getContext(), "Error deleting student, Please try again",
                    Toast.LENGTH_LONG).show();
}

if(stdel==true)
{
  notifyDataSetChanged();
}
Chirag
  • 56,621
  • 29
  • 151
  • 198
1

you will have to call notifyDataSetChanged() method of adapater. It will refresh the whole list.Try It.!

Nitin Bathija
  • 800
  • 3
  • 12
  • 24
0

use adapter.notifyDatsetChanged();

see this answer too

see this doc

Community
  • 1
  • 1
Shruti
  • 1
  • 13
  • 55
  • 95