Android的我如何检索内置画廊Picasa照片? [英] Android How do I retrieve picasa photo from built-in gallery?

查看:222
本文介绍了Android的我如何检索内置画廊Picasa照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要检索从照片内置Android库调用 ACTION_PICK 意图。
我有Picasa的图像的问题。
我已经使用了code这个<一个href=\"http://stackoverflow.com/questions/6978906/how-do-i-retrieve-the-picasa-id-url-of-an-image-from-the-gallery\">link,但它不工作(File对象不存在)。
任何想法,请。

I want to retrieve the photos from built-in Android gallery calling ACTION_PICK Intent. I have a problem with Picasa's images. I have used the code to this link, but it don't work (the File object don't exist). Any idea, please.

推荐答案

ACTIVITYRESULT_CHOOSEPICTURE是在调用startActivity时(意向,要求code)使用INT;

ACTIVITYRESULT_CHOOSEPICTURE is the int you use when calling startActivity(intent, requestCode);

public void onActivityResult(int requestCode, int resultCode, Intent data) {
  if(requestCode == ACTIVITYRESULT_CHOOSEPICTURE) {
    BitmapFactory.Options options = new BitmapFactory.Options();
    final InputStream is = context.getContentResolver().openInputStream(intent.getData());
    final Bitmap bitmap = BitmapFactory.decodeStream(is, null, options);
    is.close();
  }
}

这篇关于Android的我如何检索内置画廊Picasa照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆