Question

i want to save pictures directly to my application after taking from default camera in android .how can i make a link to my application so that after taking the picture it should ask me to save in my application or not. please help me How can i do this .please provide me a similar code so that i can understand better.

Was it helpful?

Solution

you should start the camera by intent as follows..

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, CAMERA_RESULT);

and save your image SDCard as follows..

protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK)
{
Get Bundle extras = intent.getExtras();
Bitmap bmp = (Bitmap) extras.get("data");
imv = (ImageView) findViewById(R.id.ReturnedImageView);
imv.setImageBitmap(bmp);
}
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top