비트맵 파일을 저장하고 싶어서요.. 일단 drawable에 있는 기본적인 사진을 bitmap으로 만들어서 assets폴더에 집어넣을려고하거든요 png로 변환해서 그런데 저장이 안돼네요 permission도 주고 했는데..
소스는 다음과 같습니다..
조언좀 부탁드립니다.
public void onSaveClicked(View v) {
Bitmap bitmap = null;
BitmapDrawable drawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_launcher);
bitmap = drawable.getBitmap();
try {
AssetManager am = getApplication().getAssets();
Log.i("asdasd", am.toString()+"");
File file = new File(am.toString(), "ic.png");
FileOutputStream outStream = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.flush();
outStream.close();
} catch (Exception e) {
}
}