Android无法取消取消Honeycomb上的位图错误

|| 我有一个允许用户转到照片库并选择要用作头像的照片的应用程序。除了Xoom之外,该代码在其他地方都可以正常工作,该Xoom可以启动画廊,允许用户选择照片,然后失败,并显示\“ java.lang.RuntimeException:无法取消包裹位图\”。我正在使用以下方法来调用图库:
public Intent getImagePickerIntent(int width, int height) {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType(\"image/*\");
    intent.putExtra(\"crop\", \"true\");
    intent.putExtra(\"outputX\", width);
    intent.putExtra(\"outputY\", height);
    intent.putExtra(\"aspectX\", 1);
    intent.putExtra(\"aspectY\", 1);
    intent.putExtra(\"scale\", true);
    intent.putExtra(\"noFaceDetection\", true);
    intent.putExtra(\"setWallpaper\", false);
    intent.putExtra(\"return-data\", true);

    return intent;
}
然后,我使用以下代码获取位图数据:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if(requestCode == PHOTO_PICKED) {
        // If the activity successfully captured a photo
        if(resultCode == Activity.RESULT_OK && data.getExtras() != null) {
            // Resize photo to 100x100 and then save to user\'s device
            try {
                // putting this in a try-catch after seeing odd exceptions on a Xoom
                ImageHelper.save(PrefsActivity.this, MyApplication.DEVICE_PHOTO_FILE_NAME, ImageHelper.resize((Bitmap)data.getExtras().getParcelable(\"data\"), 100, 100));
请注意,我通过调用ѭ2来获取位图 这在Android 2.3及更低版本上运行良好,知道为什么它在3.x中失败了吗? 编辑:为了使它更加令人兴奋,在常规活动中,此相同的代码在Honeycomb上也能正常工作。在PreferencesActivity中会发生此特定问题。     
已邀请:
        我最近在尝试通过onActivityResult方法返回位图时遇到了类似的问题。莫名其妙的是,以下代码可在SDK 3上运行,但无法在更大的代码上运行:
Bundle extras = intent.getExtras();                 
Bitmap bitmap = (Bitmap) intent.getParcelableExtra(\"someImage\");  
解决方法是,在使用startActivityForResult调用的活动中将位图转换为字节数组:
ByteArrayOutputStream stream = new ByteArrayOutputStream();
myBitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);            
intent.putExtra( \"myByteArray\", stream.toByteArray() );  
一旦回到onActivityResult中,我将使用以下命令进行检索:
byte[] myByteArray = intent.getExtras().getByteArray(\"myByteArray\");
然后,我使用以下代码将其转换回位图:
InputStream is = new ByteArrayInputStream(myByteArray);
Bitmap bmp = BitmapFactory.decodeStream(is);   
我希望这可以帮助别人。     

要回复问题请先登录注册