I have these codes. Camera opened, the picture is taken, but when I click on "ok" button, nothing happened. The only way to get back to previous activity is clicking the "x" button which is not useful for me :). What is the problem? (onActivityResult method is not finished yet.) (I used to use this algorithm with Android.provider.MediaStore.ACTION_IMAGE_CAPTURE intent. there was everything OK. I have no idea why I have problem now.)
public void onClick(View v) {
Intent getCameraImage = new Intent("android.media.action.IMAGE_CAPTURE");
db.open();
Cursor cr = db.getAllRecords();
int count = cr.getCount();
db.close();
File cameraFolder;
if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))
cameraFolder = new File(android.os.Environment.getExternalStorageDirectory(),"TSFC");
else
cameraFolder= ShowMessagesPage.this.getCacheDir();
if(!cameraFolder.exists())
cameraFolder.mkdirs();
File photo = new File(Environment.getExternalStorageDirectory(), "TSFC/" + (count + 1) + ".jpg");
getCameraImage.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
initialURI = Uri.fromFile(photo);
startActivityForResult(getCameraImage, CAMERA_RESULT);
}});}
protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK) {
Bundle extras = intent.getExtras();
photo = (Uri) extras.get("data");
}
}