Asha Soman
Asha Soman

Reputation: 61

How to remove an item from gallery

I created a gallery of webviews in an android app.I want to remove previously selected view from this gallery.How is it possible?

Upvotes: 1

Views: 879

Answers (1)

Behnam
Behnam

Reputation: 2278

remove it from array that attached to it's adapter then call

adapter.notifyDataSetChanged();

UPDATE:

Get item position with:

int index = gallery.getSelectedItemPosition();
galleryArray.remove(index);
galleryAdapter.notifyDataSetChanged();

Upvotes: 1

Related Questions