简体   繁体   English

在Intent.ACTION_PICK中的图片库中,我可以覆盖longClick吗?

[英]In the Gallery from Intent.ACTION_PICK, can I override the longClick?

In my app i let the user select one image from the media gallery. 在我的应用程序中,我让用户从媒体库中选择一张图像。 To do this i use the Intent.ACTION_PICK. 为此,我使用Intent.ACTION_PICK。 Like 喜欢

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, IMAGE_PICK);

The app works mostly fine, the users can select an image and the uri correctly. 该应用程序运行正常,用户可以正确选择图像和uri。

The matter is in the gallery. 这件事在画廊里。 If the user does a tap on an image all goes well, image is selected and uri returned. 如果用户在图像上轻按,则一切正常,将选择图像并返回uri。 But if the user does a long click on an image, be it accident or on purpose, the phone vibrates a split sec, the image is focused, and then nothing happens. 但是,如果用户长时间单击图像,无论是偶然还是有意为之,手机都会振动一秒钟,图像聚焦,然后什么也没有发生。 I understand on the formal gallery app this brings up a menu, but in this case it does nothing, and it can be confusing to users, to think they tapped and see the app do nothing. 我了解在正式的图库应用程序中会显示一个菜单,但在这种情况下它什么也不做,并且可能会使用户感到困惑,以为他们轻按并看到该应用程序什么也不做。

So the question is, can i do anything to change the behavior of the long click in that screen? 所以问题是,我可以做些什么来改变该屏幕中长按的行为吗? Like override the onLongClick or set an onLongClickListener or something? 喜欢覆盖onLongClick或设置onLongClickListener东西?

Thanks in advance, best regards. 在此先感谢您,最好的问候。

是的,你都可以做, onLongClick是方法和onLongClickListener是该方法的回调。

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

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