如何通过意向无果打开图库 [英] how to open gallery via intent without result
本文介绍了如何通过意向无果打开图库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿,伙计们, 从来就得到了一个小问题IM stucked用。 我有一种具有启动内置的画廊的ApplicationLauncher的。但我不希望从库得到任何结果。我只是想启动它,并希望我的启动器关闭后。
什么香港专业教育学院的尝试:
意图intentBrowseFiles =新的意图(Intent.ACTION_GET_CONTENT);
intentBrowseFiles.setType(图像/ *);
intentBrowseFiles.setFlag(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentBrowseFiles);
但doestn即使有此标志的工作......当我点击在画廊一个事先知情同意,它将关闭并返回到我的启动器。 有没有什么办法可以达到我想要做什么? 提前致谢, 马克斯
解决方案
意向意图=新的意图();
intent.setType(图像/ *);
intent.setAction(Intent.ACTION_VIEW);
startActivity(意向);
Hey guys, I´ve got a small problem im stucked with. I have a kind of an ApplicationLauncher that has to start the build-in gallery. But I dont want to get any result from that gallery... I just want to start it and want my "Launcher" to close after that.
What ive tried:
Intent intentBrowseFiles = new Intent(Intent.ACTION_GET_CONTENT);
intentBrowseFiles.setType("image/*");
intentBrowseFiles.setFlag(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentBrowseFiles);
but it doestn 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? Thanks in advance, Max
解决方案
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_VIEW );
startActivity(intent);
这篇关于如何通过意向无果打开图库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文