我製作了一個保存系統,我保存圖片,然後關閉應用程序,然後查找文件夾。我想打開圖片,但圖片打開得很慢。當我重置三星galaxyw電話時,這張照片打開速度非常快(1s)。我的代碼有什麼問題?保存並打開圖片
private String mImagePath = Environment.getExternalStorageDirectory() + "/anppp";
private File file;
public void save() {
File dirPath = new File(Environment.getExternalStorageDirectory().toString() + "/anppp");
dirPath.mkdirs();
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat formatter= new SimpleDateFormat("yyyyMMMddHmmss");
String dateNow = formatter.format(currentDate.getTime());
file = new File(mImagePath + "/"+"ProPaint-" + dateNow +".jpg");
FileOutputStream fos=null;
try {
if(!file.exists())
file.createNewFile();
fos = new FileOutputStream(file);
mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.close();
} catch (FileNotFoundException e) {
Log.e("Panel", "FileNotFoundException", e);
} catch (IOException e) {
Log.e("Panel", "IOEception", e);
}
}
你能否提供你的錯誤logcat。我們需要更多信息來幫助您解決問題。 – al23dev
可能與大圖像有關,並且還沒有創建拇指 – njzk2
09-28 15:29:20.161:W/KeyCharacterMap(1173):使用默認鍵盤映射:/system/usr/keychars/qwerty.kcm.bin – mamii