Remove image from gallery on LongClick event
I'm new in android, here i'm using Gallery
to show images in my application, working fine but the problem is now I want show some opti开发者_JAVA百科on like remove images from gallery on the LongClick
event of the user.
This answer may help you.
Use code to set onLongClickListener on Gallery object
gal.setOnLongClickListener(new OnLongClickListener()
{
@Override
public boolean onLongClick(View v)
{
// Remove element from array and call adapter.notifysetdatachanged() to update
// Gallery
return false;
}
});
精彩评论