Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android: remove a view from a gallery

I'm using a Gallery view in my app. The app is designed so that I can drag and drop a view from that Gallery.

How can I remove the dragged view from the Gallery?

like image 772
netimen Avatar asked Nov 22 '25 16:11

netimen


1 Answers

You remove it from the underlying adapter. If you do this correctly, the Gallery will refresh itself. Otherwise, call notifyDataSetChanged() on the adapter to trigger a Gallery update.

like image 66
CommonsWare Avatar answered Nov 24 '25 06:11

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!