手机有SD卡的时候:
存:
File file = new File(Environment.getExternalStorageDirectory(), filename);
FileOutputStream outStream = new FileOutputStream(file);
outStream.close();
取:与下面类似
没SD卡 默认手机内部存储:
存:
FileOutputStream os = this.openFileOutput(MD5.getMD5(url.getBytes()),this.MODE_PRIVATE);//建立输出流 image.compress(Bitmap.CompressFormat.JPEG, 100, os); os.close();取:FileInputStream ins = this.openFileInput(MD5.getMD5(url.getBytes())); image = BitmapFactory.decodeStream(ins); infoList.get(listIndex).setBitmap(image); ns.close();