Maram Watban
Maram Watban

Reputation: 29

refresh my adapter

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.

Upvotes: 1

Views: 129

Answers (3)

Chirag
Chirag

Reputation: 56925

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();
}

Upvotes: 1

Shruti
Shruti

Reputation: 5591

use adapter.notifyDatsetChanged();

see this answer too

see this doc

Upvotes: 0

Nitin Bathija
Nitin Bathija

Reputation: 810

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

Upvotes: 1

Related Questions