我正在使用 Android 将多个图像保存在 sd 卡中,但它也保存在画廊和特定文件夹中......任何人都可以帮助解决这个问题......
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAMERA_PIC_REQUEST);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_PIC_REQUEST) {
// 2
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
mImage.setImageBitmap(thumbnail);
CharSequence time2 = android.text.format.DateFormat.format(
"yymmddhhmmss", new java.util.Date());
String date1 = time2.toString();
//ByteArrayOutputStream bytes = new ByteArrayOutputStream();
try {
thumbnail .compress(CompressFormat.JPEG, 100, new FileOutputStream(Environment.getExternalStorageDirectory()
.getAbsolutePath() + "/mypics/img" + date1 + ".png"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else
Toast.makeText(getBaseContext(), "Please take snap again",
Toast.LENGTH_LONG).show();
}