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.
Asked
Active
Viewed 97 times
1

Maram Watban
- 29
- 6
3 Answers
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
-
so you mean that studentList(student id ) in class MyCustomAdapter and what about notifyDataSetChanged() where i call it – Maram Watban Dec 18 '12 at 11:16
-
@MaramWatban Call it after delete record from list. – Chirag Dec 18 '12 at 11:17
-
@MaramWatban Call notifyDataSetChanged(); after student.remove() in do background method. – Chirag Dec 18 '12 at 11:40
-
in your code if stdel == true then it not go to in that loop and not call notifydata set changed method. – Chirag Dec 18 '12 at 11:53
-
so what should i do also do i keep the studen.rem... or not – Maram Watban Dec 18 '12 at 11:57
-
have question i do not use ArrayAdapter i use ArrayList
> student; dose the same function i can do by first remove and then notifyDataSetChanged(); ? – Maram Watban Dec 18 '12 at 15:37
1
you will have to call notifyDataSetChanged() method of adapater. It will refresh the whole list.Try It.!

Nitin Bathija
- 800
- 3
- 12
- 24
-
where i can use it in class of the adapter or calss that call the adapter ? – Maram Watban Dec 18 '12 at 15:23