0
我知道呼叫系統相機的Android轉移系統相機,然後將圖像顯示在ImageView的
Intent intent = new Intent();
intent.setAction("android.media.action.STILL_IMAGE_CAMERA");
startActivity(intent);
我想在ImageView的顯示畫面,但我卻不知道該怎麼做。 有沒有人可以給我一個示例代碼?
EDIT1: 我還需要存儲
String strPath = Environment.getExternalStorageDirectory().toString();
File path = new File(strPath);
if(!path.exists())
path.mkdirs();
strFileName = "test.jpg";
strFilePath = strPath + "/" + strFileName;
File file = new File(strFilePath);
Uri uri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
我使用了代碼來存儲,但如何在拍攝時看到的預覽。
請給這個問題的正確描述。 – Shrikant
我認爲你拍照後必須使用onActivityResult方法 –