こんにちは、ユーザーが画面に描画できる Android アプリを作成しています。ボタンがあります。押すと、キャンバスが画像として内部メモリに保存されます。次のコードを試しましたが、取得し続けますFileNotFoundException open failed: EACCES (permission denied)
:
String path = Environment.getDataDirectory().getAbsolutePath();
File file = new File(path+"image.png");
Bitmap bitmap = Bitmap.createBitmap(100,200,Bitmap.Config.ARGB_8888);
FileOutputStream ostream;
try {
ostream = new FileOutputStream(file);
bitmap.compress(CompressFormat.PNG, 100, ostream);
ostream.flush();
ostream.close();
} catch (IOException e) {
e.printStackTrace();
}