如何通过意图打开画廊而没有结果? [英] How to open gallery via intent without result?

查看:125
本文介绍了如何通过意图打开画廊而没有结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种ApplicationLauncher,它必须启动内置库.但是我不想从那个画廊得到任何结果.我只想启动它,并希望我的"Launcher"在那之后关闭.

I have a kind of an ApplicationLauncher that has to start the build-in gallery. But I don't want to get any result from that gallery. I just want to start it and want my "Launcher" to close after that.

我尝试过的事情:

    Intent intentBrowseFiles = new Intent(Intent.ACTION_GET_CONTENT);
    intentBrowseFiles.setType("image/*");
    intentBrowseFiles.setFlag(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intentBrowseFiles);

,但它甚至无法与此标志一起使用.当我单击图库中的图片时,它就会关闭并返回到我的启动器".有什么方法可以实现我想做的事吗?

but it doesn't even work with this flag. As soon as I click on a pic in the gallery, it closes and returns to my "Launcher". Is there any way to achieve what I want to do?

推荐答案

    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_VIEW );
    startActivity(intent);

这篇关于如何通过意图打开画廊而没有结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆