android - 默认图片库无法以编程方式在 Android HoneyComb 平板电脑 (v 3.2) 中打开

标签 android android-3.0-honeycomb image-gallery

我正在使用此代码打开默认图像库并选择一张图像。

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse
                ("file://"+ Environment.getExternalStorageDirectory())));


    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    startActivityForResult(intent, 0);

这在 android 2.2 和 2.3 中工作得很好,但在 HoneyComb 平板电脑(v 3.2)中不起作用。

可能是什么问题?

最佳答案

    Intent intent = new Intent();

    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);

    startActivityForResult(Intent.createChooser(intent, "Complete action using"), 2);

关于android - 默认图片库无法以编程方式在 Android HoneyComb 平板电脑 (v 3.2) 中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9296599/

相关文章:

Android:在图库中延迟加载

android - Robotium 在简单的 Android JUnit 测试期间崩溃

android - 如何获取每个 Kotlin 的当前索引

android - Visual Studio 的 Android 模拟器未安装 VS 2015 或 Cordova CTP3

Android和Honeycomb-如何在没有 "action bar"的情况下使用SDK 13设置菜单图标

具有不同图像大小的 JavaScript 和 Bootstrap 图像库

android - 如何在 Android NDK 中检测手机或平板电脑

android - 创建一个在 v11 中具有额外功能但仍在 v7 中运行的应用程序

android - ActionBar 中的 ProgressBar,例如带有 Refresh 的 GMail 应用程序

带点的 jquery 画廊轮播