How to take and save picturte and get picture path via button? - android

Here, I want To take picture and save it on sd card and get path via button.
That the picture path can see into TextView.
how can i do it?
public class MainActivity extends AppCompatActivity {
private static final int CAMERA_PIC_REQUEST = 1111;
private ImageView mImage;
Button camera;
Button path;
TextView tvPath;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImage = (ImageView) findViewById(R.id.camera_image);
path = (Button) findViewById(R.id.btnPath);
tvPath = (TextView) findViewById(R.id.tvPath);
//1
camera.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAMERA_PIC_REQUEST);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_PIC_REQUEST) {
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
mImage.setImageBitmap(thumbnail);
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
File file = new File(Environment.getExternalStorageDirectory()+File.separator + "image.jpg");
try {
file.createNewFile();
FileOutputStream fo = new FileOutputStream(file);
fo.write(bytes.toByteArray());
fo.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Sorry for English.

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_PIC_REQUEST) {
Uri filePath = data.getData();
String fullFilePath = FilePath.getPath(this, filePath);
if (fullFilePath != null) {
String filename = fullFilePath.substring(fullFilePath.lastIndexOf("/") + 1);
tvFilename.setText(filename);
}
}

Related

Cant load picture

I have a problem when I'm trying to load a picture that saved on the phone.
I have a "Helper class"
public class FileHelper {
public static String saveBitmapToFile(Bitmap bitmap, Context context, String fileName) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
// write the compressed bitmap to the outputStream(bytes)
bitmap.compress(Bitmap.CompressFormat.PNG, 100, bytes);
FileOutputStream fo = null;
try {
fo = context.openFileOutput(fileName, Context.MODE_PRIVATE);
} catch (FileNotFoundException e) {
Toast.makeText(context, "בעיה ,", Toast.LENGTH_SHORT).show();
}
try {
fo.write(bytes.toByteArray());
fo.close();// close file output
} catch (IOException e) {
e.printStackTrace();
}
return fileName;
}
}
Here's where I'm trying to upload the photo:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile2);
iv = (ImageView) findViewById(R.id.ivPic);
btnTakePic = (Button) findViewById(R.id.btnpic);
btnPickPicture = (Button) findViewById(R.id.btnpicpic);
try {
bitmap = BitmapFactory.decodeStream(this.openFileInput(PIC_FILE_NAME));
} catch (FileNotFoundException e) {
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.cam);
}
iv.setImageBitmap(bitmap);
btnTakePic.setOnClickListener(this);
btnPickPicture.setOnClickListener(this);
}
public void onClick(View v) {
Intent intent = null;
if (v == btnTakePic) {
intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, TAKE_PICTURE);
} else if (v == btnPickPicture) {
Intent pickPickIntent = new Intent(Intent.ACTION_PICK);
File picDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
String picDirPath = picDir.getPath();
Uri uData = Uri.parse(picDirPath);
pickPickIntent.setDataAndType(uData, "image/*");
startActivityForResult(pickPickIntent, PICK_PICTURE);
}
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == TAKE_PICTURE && resultCode == RESULT_OK)
{
bitmap = (Bitmap) data.getExtras().get("data");
iv.setImageBitmap(bitmap);
FileHelper.saveBitmapToFile(bitmap,getApplicationContext(),PIC_FILE_NAME);
Bitmap bitmapx = iv.getDrawingCache();
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("BitmapImage", bitmapx);
} else if (requestCode == PICK_PICTURE) {
if (resultCode == RESULT_OK) {
Uri URI = data.getData();
String[] FILE = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(URI,
FILE, null, null, null);
cursor.moveToFirst();
options = new BitmapFactory.Options();
int columnIndex = cursor.getColumnIndex(FILE[0]);
String ImageDecode = cursor.getString(columnIndex);
cursor.close();
options.inSampleSize = 5;
Bitmap bmp = BitmapFactory.decodeFile(ImageDecode, options);
iv.setImageBitmap(bmp);
FileHelper.saveBitmapToFile(bmp,getApplicationContext(),PIC_FILE_NAME);
Bitmap bitmapx = iv.getDrawingCache();
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("BitmapImage", bitmapx);
}
}
}
and Here is where I am trying to load the saved pic:
private void updateHeader()
{
ImageView ivHeader = (ImageView) mNavigationView.getHeaderView(0).findViewById(R.id.ivHeader);
try{
bitmap= BitmapFactory.decodeStream(this.openFileInput(PIC_FILE_NAME));
ivHeader.setImageBitmap(bitmap);
}
catch (FileNotFoundException e){
Toast.makeText(getApplicationContext(),"error occured",Toast.LENGTH_LONG);
}
}
I have to say that the Toast message is not shown and There are no errors. App not crashing but the pic stays with no change.
Make sure you have external read storage permission. Here is how to request permission.
PS: Also make sure you have added that permission to AndroidManifest.xml

Cropping image doesn't work (Android)

Sorry for my English. I tried to crop an image. I use the library you can find at 1 and standard Android methods. But for some devices, CropImage.class can't be opened, I don't know why this happens.
My code for the get image function
//method for get image from camera
public void getPhotoCamera() {
dialogBuilder.cancel();
final int REQUEST_CAMERA = 2;
final String dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/test/";
newfile = new File(dir);
outputFileUri = Uri.fromFile(newfile);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, REQUEST_CAMERA);
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
switch(requestCode) {
case 2:
try{
Bitmap myBitmap = decodeUri(outputFileUri);
Bitmap orientation = ExifUtil.rotateBitmap(newfile.getAbsolutePath(), myBitmap);
//start crop image
startCrop(orientation);
}catch(Exception e) {
Log.e("Photo", e.toString());
}
break;
}
}
//method start crop
public void startCrop(Bitmap bm) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
Intent in1 = new Intent(this, Crop.class);
in1.putExtra("image",byteArray);
startActivity(in1);
}
The class crop
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.p_crop);
if(getSupportActionBar() != null) getSupportActionBar().hide();
Intent intent = getIntent();
Bundle extra = intent.getExtras();
if(extra != null) {
try{
byte[] byteArray = getIntent().getByteArrayExtra("image");
bmp = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
} catch (Exception e) {
Log.e("error", e.toString());}
}
final CropImageView cropImageView = (CropImageView)findViewById(R.id.cropImageView);
cropImageView.setMinFrameSizeInDp(100);
cropImageView.setImageBitmap(bmp);
RelativeLayout cropButton = (RelativeLayout)findViewById(R.id.crop_button);
cropButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
cropImageView.getCroppedBitmap().compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
}
});
}
Why do you pass byteArray to Crop.class? use URI instead.
Try below codes:
//method for get image from camera
public void getPhotoCamera() {
dialogBuilder.cancel();
final int REQUEST_CAMERA = 2;
final String dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/test/";
newfile = new File(dir);
outputFileUri = Uri.fromFile(newfile);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, REQUEST_CAMERA);
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
switch(requestCode) {
case 2:
startCrop();
break;
}
}
//method start crop
public void startCrop() {
Intent in1 = new Intent(this, Crop.class);
in1.putExtra("image", outputFileUri);
startActivity(in1);
}
and the class:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.p_crop);
if(getSupportActionBar() != null) getSupportActionBar().hide();
Bitmap bitmap = null;
try {
Intent intent = getIntent();
imageUri = intent.getParcelableExtra("image");
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageUri);
} catch (Exception e) {
e.printStackTrace();
}
if (bitmap != null) {
final CropImageView cropImageView = (CropImageView)findViewById(R.id.cropImageView);
cropImageView.setMinFrameSizeInDp(100);
cropImageView.setImageBitmap(bitmap);
}
}

i want to add text after capture image and then want to share that image

i have done with image capture now i want to add some text on captured image.
Also i want to save it as image and want to share.
Following is the code.
public class Main extends Activity implements OnClickListener {
private static final int TAKE_PICTURE = 0;
private Uri mUri;
private Bitmap mPhoto;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
((Button) findViewById(R.id.snap)).setOnClickListener(this);
((Button) findViewById(R.id.rotate)).setOnClickListener(this);
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case TAKE_PICTURE:
if (resultCode == Activity.RESULT_OK) {
getContentResolver().notifyChange(mUri, null);
ContentResolver cr = getContentResolver();
try {
mPhoto = android.provider.MediaStore.Images.Media.getBitmap(cr, mUri);
((ImageView)findViewById(R.id.photo_holder)).setImageBitmap(mPhoto);
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
}
}
#Override
public void onClick(View v) {
if (v.getId()== R.id.snap) {
Intent i = new Intent("android.media.action.IMAGE_CAPTURE");
File f = new File(Environment.getExternalStorageDirectory(), "photo.jpg");
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
mUri = Uri.fromFile(f);
startActivityForResult(i, TAKE_PICTURE);
} else {
if (mPhoto!=null) {
Matrix matrix = new Matrix();
matrix.postRotate(90);
mPhoto = Bitmap.createBitmap(mPhoto , 0, 0, mPhoto.getWidth(), mPhoto.getHeight(), matrix, true);
((ImageView)findViewById(R.id.photo_holder)).setImageBitmap(mPhoto);
}
}
}
}

Saving/renaming taken photos on sd-card in Android

i've used code from link below,was very helpfull,thank you:
http://www.tutorialforandroid.com/2010/10/take-picture-in-android-with.html
need help with some photo issues! takePhoto() starts MediaStore.ACTION_IMAGE_CAPTURE, getFile() creates "Image keeper" directory and then saves taken picture under "Image-SOMENUMBER.jpg" name!in onActivityResult() i'd like to show taken picture as ImageView and i'd like to rename picture to something user inputs in edittext or something!
have two questions:
1) why can't i get ImageView to show my picture in try{} part? what am i doing wrong? how can i get a path of saved image?
2) is there a way i can enable users to name photos the way they want?(something like "save as" or renaming on some button click ect.)
any idea is welcome!thank you!
here is the code:
private static final int TAKE_PHOTO_CODE = 1;
private void takePhoto(){
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(getFile(this)) );
startActivityForResult(intent, TAKE_PHOTO_CODE);
}
private File getFile(Context context){
final File path = new File( Environment.getExternalStorageDirectory(), "Image keeper" );
if(!path.exists()){
path.mkdir();
}
String name;
int n = 100000;
int rand;
rand = new Random().nextInt(n);
name = "Image-" + rand + ".jpg";
File file = new File(path,name);
return file;
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
switch(requestCode){
case TAKE_PHOTO_CODE:
final File file = getFile(this);
try {
Bitmap captureBmp;
captureBmp = Media.getBitmap(getContentResolver(), Uri.fromFile(file) );
iv = (ImageView) findViewById(R.id.imageView1);
iv.setImageBitmap(captureBmp);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
break;
}
}
}
couldn't solve renaming part of my problem but this piece of code did a job for me! i'm sure it can be done a bit fancier but it works! it involves taking picture, saving to sd card and getting path to it!
ImageView iv;
static File image;
Uri ImageUri;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button) findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
takePhoto();
}
});
}
private static final int TAKE_PHOTO_CODE = 1;
private void takePhoto(){
image = getFile(this);
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image) );
startActivityForResult(intent, TAKE_PHOTO_CODE);
}
private File getFile(Context context){
final File path = new File( Environment.getExternalStorageDirectory(), "Image keeper" );
if(!path.exists()){
path.mkdir();
}
String name;
int n = 100000;
int rand;
rand = new Random().nextInt(n);
name = "Image-" + rand + ".jpg";
File fileimage = new File(path, name);
return fileimage;
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
switch(requestCode){
case TAKE_PHOTO_CODE:
try {
Bitmap captureBmp;
captureBmp = Media.getBitmap(getContentResolver(), Uri.fromFile(image) );
ImageUri = Uri.fromFile(image);
String pathToImage = ImageUri.getPath();
iv = (ImageView) findViewById(R.id.imageView1);
iv.setImageBitmap(captureBmp);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
iv.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
iv.setAdjustViewBounds(true);
break;
}
}
}

image attach option is not coming after taking image from camera

frnds,on clicking on button i open camera for taking picture ,i take picture successfull and now only two option is coming after clicking pic,"save" and "Discard",there is not any option for attaching the camera clicked image so how to attach image and display image in next view?
my code is ...
public void function2(int id){
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_PIC_REQUEST||requestCode == SELECT_PICTURE) {
try{
try{
selectedImageUri = data.getData();
//OI FILE Manager
String filemanagerstring = selectedImageUri.getPath();
//MEDIA GALLERY
selectedImagePath = getPath(selectedImageUri);
//DEBUG PURPOSE - you can delete this if you want
if(selectedImagePath!=null){
Intent i=new Intent(MainMenu.this,Imageprview.class);
startActivity(i);
System.out.println(selectedImagePath);
}
else
System.out.println("selectedImagePath is null");
if(filemanagerstring!=null)
System.out.println(filemanagerstring);
else System.out.println("filemanagerstring is null");
//NOW WE HAVE OUR WANTED STRING
if(selectedImagePath!=null)
System.out.println("selectedImagePath is the right one for you!");
else
System.out.println("filemanagerstring is the right one for you!");
}catch (NullPointerException e) {
// TODO: handle exception
} }catch (ArrayIndexOutOfBoundsException e) {
// TODO: handle exception
} }
}
//UPDATED!
public String getPath(Uri uri) {
String[] projection = {MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(uri, projection, null, null, null);
if(cursor!=null)
{
//HERE YOU WILL GET A NULLPOINTER IF CURSOR IS NULL
//THIS CAN BE, IF YOU USED OI FILE MANAGER FOR PICKING THE MEDIA
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
else return null;
}
Button btnCam=(Button)findViewById(R.id.camBtn);
btnCam.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Intent detailActivity = new Intent(getBaseContext(),com.rodasys.profile.detailProfile.class);
//startActivity(detailActivity);
saveImage();
} });
}
public void saveImage()
{
try {
FileOutputStream fos = openFileOutput("MyFile.jpeg", Context.MODE_WORLD_WRITEABLE);
fos.close();
File f = new File(getFilesDir() + File.separator + "MyFile.jpeg");
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,90);
startActivityForResult(intent,IMAGE_CAPTURE);
//startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)),IMAGE_CAPTURE);
}
catch(IOException e) {
}
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 0) {
if (resultCode == RESULT_OK){
finish();
//imageView=(ImageView)findViewById(R.id.imageView1);
//imageView.setImageURI(imageUri);
Intent detActivity = new Intent(getBaseContext(),com.rodasys.profile.detailProfile.class);
startActivity(detActivity);
//Log.d("ANDRO_CAMERA","Picture taken!!!");
//
}
}
}
IN DETAIL PROFILE ACTIVITY
public class detailProfile extends Activity{
String fname=new File(getFilesDir(),"MyFile.jpeg").getAbsolutePath();
//USING THIS FILE PATH YOU CAN LOAD THE IMAGE IN THIS ACTIVITY
}
YOU HAVE ANOTHER OPTION YOU CAN PASS THE IMAGE TO THROUGH THE INTENT AT THE TIME OF CREATING THE NEW INTENT AND AFTER THAT YOU CAN ACCESS THAT IMAGE THROUGH THE BUNDLE OBJECT IN THE NEW INTENT.
bytes[] imgs = ... // your image
Intent intent = new Intent(this, YourActivity.class);
intent.putExtra("img", imgs);
startActivity(intent)
in detailprofile
bytes[] receiver = getIntent().getExtra("imgs");
//using Byte array you can display your image in ur imageview
There is no such option available.you can save file in to sdcard or any external storage
c the code i have done for saving image in external storage.
public void onClick(View v)
{
if(v == imgForPhotograph) {
path = Environment.getExternalStorageDirectory() + "/photo1.jpg";
File file = new File(path);
Uri outputFileUri = Uri.fromFile(file);
Intent intent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY);
}
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
System.gc();
if (requestCode == CAPTURE_IMAGE_ACTIVITY) {
if (resultCode == Activity.RESULT_OK) {
try {
// Call function MakeFolder to create folder structure if
// its not created
if(imageBitmap != null) {
imageBitmap = null;
imageBitmap.recycle();
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 3;
imageBitmap = BitmapFactory.decodeFile(path, options);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
imageBitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); // bm
byte[] bmpbyte = baos.toByteArray();
//
Imagebase64= Base64.encodeToString(bmpbyte, Base64.DEFAULT); // set
imgForPhotograph.setImageBitmap(imageBitmap);
isImageTaken = true;
// Name for image
IMAGEPATH = getString(R.string.Image)
+ System.currentTimeMillis();
SaveImageFile(imageBitmap,IMAGEPATH);
} catch (Exception e) {
Toast.makeText(this, "Picture Not taken",
Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
}
}
All The Best....
Hi guys, this code is working. For camera and stored into sd card:
public class CampicsaveActivity extends Activity
{
/** Called when the activity is first created. */
FrameLayout frm;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
frm=(FrameLayout)findViewById(R.id.preview);
Button btnCam=(Button)findViewById(R.id.buttonClick);
btnCam.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
// Intent detailActivity = new Intent(getBaseContext(),com.rodasys.profile.detailProfile.class);
// startActivity(detailActivity);
saveImage(0);
} });
}
public void saveImage(int IMAGE_CAPTURE)
{
try
{
FileOutputStream fos = openFileOutput("MyFile.jpeg", Context.MODE_WORLD_WRITEABLE);
fos.close();
File f = new File(getFilesDir() + File.separator + "MyFile.jpeg");
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,90);
startActivityForResult(intent,IMAGE_CAPTURE);
//startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)),IMAGE_CAPTURE);
}
catch(IOException e)
{;}
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == 0)
{
if (resultCode == RESULT_OK)
{
finish();
//imageView=(ImageView)findViewById(R.id.imageView1);
//imageView.setImageURI(imageUri);
Intent detActivity = new Intent(getBaseContext(),CampicsaveActivity.class);
startActivity(detActivity);
//Log.d("ANDRO_CAMERA","Picture taken!!!");
//
}
}
}
}
}

Categories

Resources