开发者

Remove image from gallery on LongClick event

开发者 https://www.devze.com 2023-03-27 11:37 出处:网络
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 LongCli

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号