//拍摄完照片后执行的方法
protected void onActivityResult(int requestCode, int resultCode, Intent data){
if (requestCode == TAKE_PICTURE) {
if (resultCode == RESULT_OK) {
Bitmap bm = (Bitmap) data.getExtras().get("data");
TakePictureActivity.bm=bm;
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
File myCaptureFile = new File("sdcard/Allimage_Theelderly/"+df.format(new Date())+".jpg");
try {
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(myCaptureFile));
bm.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
bos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Intent takepic = new Intent(this,TakePictureActivity.class);
startActivity(takepic);
}