Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6882107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:12:44+00:00 2026-05-27T05:12:44+00:00

In my application i have Implement to take image from Gallery. In that gallery

  • 0

In my application i have Implement to take image from Gallery.
In that gallery is open on the click of button and after selecting the image, that activity is close and selected image is shown to the previous activity ImageView.

As like that, I want to imaplement the Camera preview that captured the image from camera Activity and after taking captured image i come back to my original activity with that captured image.

So how to implement such technique ??
Or is there any demo that take captured image from android camera and come back to original activity with that captured image ???

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:12:45+00:00Added an answer on May 27, 2026 at 5:12 am

    Is this, what you looking for? (AS I Understand you question)

    In Manafiest.xml

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    

    In your activity

    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(getTempFile(this)) ); 
      startActivityForResult(intent, TAKE_PHOTO_CODE);
    }
    
    private File getTempFile(Context context){
      //it will return /sdcard/image.tmp
      final File path = new File( Environment.getExternalStorageDirectory(), context.getPackageName() );
      if(!path.exists()){
        path.mkdir();
      }
      return new File(path, "image.tmp");
    }
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (resultCode == RESULT_OK) {
        switch(requestCode){
          case TAKE_PHOTO_CODE:
            final File file = getTempFile(this);
            try {
              Bitmap captureBmp = Media.getBitmap(getContentResolver(), Uri.fromFile(file) );
              // do whatever you want with the bitmap (Resize, Rename, Add To Gallery, etc)
            } catch (FileNotFoundException e) {
              e.printStackTrace();
            } catch (IOException e) {
              e.printStackTrace();
            }
          break;
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java application that will take the image as an input and
I have an application that has multiple threads processing work from a todo queue.
I have a Winforms application that the user uses to take a region based
I have an application that experiences a slow memory leak from the word go.
I have to implement the VinPower application. They offer a Java version, a C
I have a school project in which I have to implement a chat application,
We are trying to implement a REST API for an application we have now.
I am creating an application. I have to implement a bookmark feature, and adding
I have an application where I am trying to implement a safe file overwrite
I have an MFC application compiled with /clr and I'm trying to implement a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.