首页 > 解决方案 > 如何在“最近”以外的地方打开 Android Image Picker?

问题描述

我正在使用以下代码在 Android 上打开图像选择器。

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
fragment.startActivityForResult(Intent.createChooser(intent, "Gallery"), Constants.RetCodes.SELECT_PIC);

这将打开从不包含任何图像的“最近”目录。每次运行该应用程序时,我都必须打开左上角的汉堡菜单并选择“照片”,然后在屏幕上再次选择“照片”才能真正获得任何照片。

如何强制选择器立即在“照片|照片”中打开,而不是转到“最近”,这完全没用?

标签: androidandroid-studioandroid-intentandroid-galleryandroid-intent-chooser

解决方案


推荐阅读