【问题标题】:How to open the image in the Android's default gallery [duplicate]如何在Android的默认图库中打开图像[重复]
【发布时间】:2011-09-22 12:05:13
【问题描述】:

可能重复:
How to open phones gallery through code

我在我的应用中输出了一张图片。我可以调用默认Android的画廊来显示图像,而不是使用ImageView来查看图像。 非常感谢!

【问题讨论】:

  • 我想在android系统中使用默认的Image Viewer。由于我想使用查看器的某些功能。可以跳过进入图库并进入默认图像查看器

标签: android image-processing android-gallery


【解决方案1】:

试试这个打开画廊

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);//
startActivityForResult(Intent.createChooser(intent, "Select Picture"),10);

【讨论】:

    【解决方案2】:

    您应该能够使用此代码在图库中显示图像..

    Intent intentquick = new Intent(Intent.ACTION_VIEW);
    intentquick.setDataAndType(<full path to image to be displayed>,"image/*");
    
    intentquick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intentquick);
    

    【讨论】:

      猜你喜欢
      • 2011-07-20
      • 1970-01-01
      • 1970-01-01
      • 2015-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 1970-01-01
      相关资源
      最近更新 更多