私は現在、カメラを使用して写真を撮るときに画像を保存するときに特定のフォルダーの場所に保存するアプリを作成しようとしています。フォルダーが現在電話に存在しない場合は、フォルダーを作成してファイルを保存しますその場所へ。試してみましたが、私のコードは現在機能しません。私のコードを見て、私が何をする必要があるか教えてください。
コードは次のとおりです。
else if(v==camera){
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File newDirectory = new File(Environment.getExternalStorageDirectory() + "App_Pictures/");
String filename = new String("image1.jpeg");
File outputFile = new File(newDirectory, filename);
outputFile.mkdirs();
startActivity(intent);
}