我正在尋找一種在android文件系統中臨時保存位圖文件的方法。該文件是必需的,直到它被用作服務器POST請求的一部分後,我希望它不再存在。我正在尋找更快的方式來做到這一點。Android臨時保存位圖圖像
...
File file = new File(Environment.getExternalStorageDirectory().getPath().toString()+"/ImageDB/" + fileName+".png");
FileOutputStream filecon = new FileOutputStream(file);
sampleResized.compress(Bitmap.CompressFormat.JPEG, 90, filecon);
...
我目前正在使用這種方法。
編輯:我有我的解決方案從Creating temporary files in Android