我无法显示使用 3rd 方 android 应用程序捕获的当前图像并将其显示在我自己的本机应用程序上。它总是一个只有操作栏的空屏幕。但是,拍摄的照片可能位于我指定的文件夹中。
有人可以帮忙吗?非常感激!干杯:)
XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:id="@+id/linear">
  <ImageView android:id="@+id/imageView1"
    android:layout_width="fill_parent" android:layout_height="fill_parent" 
    android:contentDescription="@string/desc"/>
</LinearLayout>
源代码:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
    super.onActivityResult(requestCode, resultCode, data); 
    switch(requestCode) {
    case 0:
        if(resultCode == Activity.RESULT_OK){  
            Bitmap photo = (Bitmap) data.getExtras().get("data"); 
            imageView.setImageBitmap(photo);
        }
    break; 
    case 1:
        if(resultCode == RESULT_OK){  
            Uri selectedImage = data.getData();
            imageView.setImageURI(selectedImage);
        }
    break;
    }
  }
}