android Camera拍照存储,但是sdcard木有照片啊该怎么处理

   阅读
android Camera拍照存储,但是sdcard木有照片啊
[code=Java][/code]private final class TakePictureCallback implements PictureCallback {

@Override
public void onPictureTaken(byte[] data, Camera camera) {

Log.d(TAG, "TakePictureCallback:"+data.length);
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
Matrix matrix = new Matrix();
Log.d(TAG, "bitmap width:"+bitmap.getWidth()+"height:"+bitmap.getHeight());
Bitmap picture = Bitmap.createBitmap(bitmap, 0, 0, 272, 272, matrix, true);
Log.d(TAG, "TakePictureCallback:"+picture);

/* 照片将被保存到 SD 卡跟目录下,文件名为系统时间,后缀名为".jpg" */

String SDMountType = Environment.getExternalStorageState();
if (SDMountType.equals(Environment.MEDIA_MOUNTED)){
 
File file = new File(Environment.getExternalStorageState(), System.currentTimeMillis() + ".jpg");
try {

FileOutputStream fos = new FileOutputStream(file);

/* 位图格式为JPEG
* 参数二位 0-100 的数值,100为最大值,表示无损压缩 
* 参数三传入一个输出流对象,将图片数据输出到流中 
*/
bitmap.compress(CompressFormat.JPEG, 100, fos);
fos.write(data);
fos.flush();
fos.close();

} catch (IOException e) {
e.printStackTrace();
}
}else{

Toast.makeText(CameravedioActivity.this, "sd card error!", Toast.LENGTH_LONG).show();
}


imageView.setImageBitmap(bitmap);
/* 拍完照后回到预览状态,继续取景 */
camera.startPreview();
}
}

------解决方案--------------------
Environment.getExternalStorageState()方法用于获取SDCard的状态
Environment.getExternalStorageDirectory()方法用于获取SDCard的目录
阅读