简体   繁体   English

在 LongClick 事件中从图库中删除图像

[英]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 option like remove images from gallery on the LongClick event of the user.我是 android 的新手,在这里我使用Gallery在我的应用程序中显示图像,工作正常,但问题是现在我想显示一些选项,例如在用户的LongClick事件中从图库中删除图像。

This answer may help you. 这个答案可能会对你有所帮助。

Use code to set onLongClickListener on Gallery object使用代码在 Gallery object 上设置onLongClickListener

gal.setOnLongClickListener(new OnLongClickListener() 
{

    @Override
    public boolean onLongClick(View v) 
    {
        // Remove element from array and call adapter.notifysetdatachanged() to update
        // Gallery

        return false;
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM