サードパーティの 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;
}
}
}