【问题标题】:Open image in android Built-In Gallery only仅在 android 内置图库中打开图像
【发布时间】:2012-11-08 22:52:58
【问题描述】:

我只需要在内置图库中打开一个图像,没有意图选择器。 如果我使用 ACTION_VIEW,我会自动获得选择器。

有什么办法吗?

发送,

【问题讨论】:

    标签: android image gallery


    【解决方案1】:

    这将打开图库(而不是选择器)。在 Galacxy S 上在 Android 2.3.3 上测试

    Intent intent = new Intent(Intent.ACTION_VIEW,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(intent, 0);
    

    【讨论】:

      【解决方案2】:

      内置图库可以这样打开:

      Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
      startActivityForResult(intent, 0);
      

      【讨论】:

        【解决方案3】:

        您是否尝试过使用Intent.setClassName?然后,您可以指定图库意图并完全绕过选择器。

        final Intent intent = new Intent(); intent.setClassName("com.google.android.gallery3d", "com.android.gallery3d.app.Gallery"); startActivity(intent);

        将在 Samsung Galaxy Nexus Android 4.0 Jelly Bean 上启动图库应用程序。在三星 Galaxy S2 上,它是 "com.cooliris.media", "com.cooliris.media.Gallery"。您必须找出特定手机的类名,因为它对于任何给定的手机都是不同的。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-07-30
          • 1970-01-01
          • 2014-09-29
          • 2023-03-03
          • 1970-01-01
          • 1970-01-01
          • 2017-07-23
          相关资源
          最近更新 更多