public class ActiEnvi extends Activity {
static final String TAG = "ActiEnvi";
private static final int REQ_CODE_CAMERA = 0x1;
private String imgpath = "";
private String tempath = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
(savedInstanceState);
setContentView(.acti_envi);
......
}
......
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Take the photo successfully and return
if (requestCode == REQ_CODE_CAMERA
&& resultCode == Activity.RESULT_OK) {
= tempath;
Bitmap bm = ();
(bm);
(ScaleType.FIT_CENTER);
}
}
.......
// Call the system camera to take photos
protected void captureImage() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
tempath = ();
File out = new File(tempath);
(MediaStore.EXTRA_OUTPUT, (out));
startActivityForResult(intent, REQ_CODE_CAMERA);
}
......
}