關於照相功能

今天作項目的時候發現一個問題,就是有一些android手機沒有照相功能,好比三星和摩托的一款手機,具體是哪一個型號我也忘記了,但願你們在作的時候儘可能注意點 android

try {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
currentCameraFile = FileUtils.getPhotoRootPath();
Uri uri = Uri.fromFile(currentCameraFile);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);// 照片輸出目錄
startActivityForResult(intent,PHOTOHRAPH);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "此手機照相功能發生異常", 0).show();
return;
}
get

相關文章
相關標籤/搜索