Сохранение файла:
FileOutputStream fo = null;
try {
fo = this.openFileOutput("test.png", Context.MODE_WORLD_READABLE);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
bitmap.compress(CompressFormat.PNG, 100, fo)
Загрузка файла:
String fname = this.getFilesDir().getAbsolutePath()+"/test.png";
Bitmap bMap = BitmapFactory.decodeFile(fname);
i.setImageBitmap(bMap);
Последняя строка дает исключение нулевого указателя, почему BitmapFactory.decodeFile возвращает ноль? Я могу убедиться, что файл сохранен правильно, так же как я могу вытащить его с помощью adb и увидеть, как png отображается правильно.