[問題] camera 指定路徑
我想請問一下!利用intent 去開啟相機
要如設定拍完照將照片存成jpg存在媒體庫裡面!
假設手機沒有裝外接的sd卡!要如何設定?
開啟相機
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
拍完照接收
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
// Image captured and saved to fileUri specified in the Intent
Toast.makeText(this, "Image saved to:\n" + data.getData(),
Toast.LENGTH_LONG).show();
} else if (resultCode == RESULT_CANCELED) {
// User cancelled the image capture
} else {
// Image capture failed, advise user
}
}
}
以上是程式...
但使用這個方式會遇到android不同版本!回存照片位置會有接收不到的問題!
(以上是使用手機本身照相功能!不是使用LINE那些的照相功能)
想請問各位大大有甚麼解決方案!!
最近卡在這卡很久了!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 1.34.192.12
→
09/27 09:49, , 1F
09/27 09:49, 1F
→
09/27 13:11, , 2F
09/27 13:11, 2F
推
09/27 21:06, , 3F
09/27 21:06, 3F
→
09/30 09:58, , 4F
09/30 09:58, 4F
→
09/30 13:40, , 5F
09/30 13:40, 5F
→
09/30 13:41, , 6F
09/30 13:41, 6F
→
10/01 11:24, , 7F
10/01 11:24, 7F