Android Gallery 3D不';蜂窝中的t返回位图

Android Gallery 3D不';蜂窝中的t返回位图,android,bitmap,android-intent,Android,Bitmap,Android Intent,我使用这两个类从图库中请求和检索图片。这段代码在姜饼及以下版本中运行良好,但在Xoom上的蜂巢中它失败了 我看到的行为是,它写入一个空白文件,但画廊不会将所选图片写入该文件。此外,该文件在Windows中不可见。我必须转到DDMS选项卡以查看要创建的文件。它拥有所有者和组的rw访问权限,但不是所有人 改编自: 启动获取照片的意图 final Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*

我使用这两个类从图库中请求和检索图片。这段代码在姜饼及以下版本中运行良好,但在Xoom上的蜂巢中它失败了

我看到的行为是,它写入一个空白文件,但画廊不会将所选图片写入该文件。此外,该文件在Windows中不可见。我必须转到DDMS选项卡以查看要创建的文件。它拥有所有者和组的rw访问权限,但不是所有人

改编自:


启动获取照片的意图

final Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
activity.startActivityForResult(intent, requestCode);
在返回时接受照片

final InputStream is = context.getContentResolver().openInputStream(intent.getData());
final Bitmap imageData = BitmapFactory.decodeStream(is, null, options);
is.close();
这个问题太让人恼火了,我写了一整篇关于如何正确处理的文章。或者至少是最好的方式

final InputStream is = context.getContentResolver().openInputStream(intent.getData());
final Bitmap imageData = BitmapFactory.decodeStream(is, null, options);
is.close();