Android のアプリからカメラ アプリを開く次のコードがあります。Samsung Galaxy Nexus では正常に動作しますが、Samsung Galaxy S3 ではクラッシュします。残念ながら、問題をデバッグするための後者のデバイスがありません。何か提案はありますか?
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
File dir = new File(Environment.getExternalStorageDirectory() + File.separator + this.getString(R.string.kda_images));
File file = new File(Environment.getExternalStorageDirectory() + File.separator + this.getString(R.string.kda_images) + File.separator + "Image-" + dir.listFiles().length + ".jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));//The selected image is created in the specified location: file
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));//Refreshes the directory to show the new image
startActivityForResult(intent, CAPTURE_NEW_IMAGE);