【发布时间】:2013-06-04 22:45:35
【问题描述】:
我正在寻找一种从意图打开 Android 画廊应用程序的方法。
我不想返回图片,而只是打开图库以允许用户使用它,就像他们从启动器中选择它一样 (View pictures/folders)。
我已尝试执行以下操作:
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
但是,这会导致应用程序在我选择图片后关闭(我知道这是因为ACTION_GET_CONTENT),但我只需要打开图库。
任何帮助都会很棒。
谢谢
【问题讨论】:
-
这应该回答你的问题...stackoverflow.com/a/4979492/1620738
-
你的 minSdkVersion 版本是多少?
标签: java android android-intent