私のAndroidプロジェクトでは、イメージファイルをデバイスに保存しています。そこに私はファイルを作成するために次のコードを使用します。Androidファイルが作成されていません
File folder = new File(getFilesDir());
if (!folder.exists()) {
folder.mkdir();
}
File imageFile = new File(folder, filename);
try
{
FileOutputStream fos = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.close();
}
catch (Exception e)
{
e.printStackTrace();
}
が、これはそうファイルは作成しないと思われるのFileOutputStream
FileOutputStream fos = new FileOutputStream(imageFile);
を作成するときに私が見つからない例外をファイルできます。どうすればこの問題を解決できますか?
あなたは[持っているあなたは、「ファイル名」 –
を標的にしている場合、ファイルが/storage/emulated/0/PAssets/PProfilePicture.png –
@PierGiorgioMisleyの値であり、デバッグ、Android用> 23 –