我使用以下代码从库中选择一张图片.
Intent intent_gallery = new Intent();
intent_gallery.setType("image/*");
intent_gallery.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent_gallery, 1);
Run Code Online (Sandbox Code Playgroud)
但是,我不需要它来查看选择图片的其他应用程序.我希望它直接打开默认图库,而不是向我展示选择图片的其他应用程序.
Intent intent_gallery = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent_gallery, 1);
Run Code Online (Sandbox Code Playgroud)
得到它..为我工作!!
| 归档时间: |
|
| 查看次数: |
2902 次 |
| 最近记录: |