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

  • SEARCH
  • Home
  • 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 8801861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:56:31+00:00 2026-06-14T00:56:31+00:00

I am trying to get the image from the camera. It works fine. I

  • 0

I am trying to get the image from the camera. It works fine. I can take a photo and show it on the image view. Actually, I want to send this photo to my server after took. To do that, I try to pull the image in onActivityResult. But, when i check the Intent data, it always return null.Even though, the application runs fine and display the image. Why am I getting null for Intent data? Could you please help me?

Here is the code:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (requestCode) {
        case ACTION_TAKE_PHOTO_B: {
            if (resultCode == RESULT_OK) {
                        Log.e("TAG","data: "+data);
                    display_Photo();            


            //Process the image to send but, data is null   
            }
            break;
        }

    } 
    }

Log cat:

data : Null

  • 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-06-14T00:56:32+00:00Added an answer on June 14, 2026 at 12:56 am

    In the code you are using there are two button onclick handlers that call:
    dispatchTakePictureIntent(int actionCode)

    One button calls it with the enum ACTION_TAKE_PHOTO_B while the other call sit with the enum ACTION_TAKE_PHOTO_S

    If you are passing in ACTION_TAKE_PHOTO_B, then the expected result of data in the returned intent is null.

    The reason why is that before dispatchTakePictureIntent calls the intent MediaStore.ACTION_IMAGE_CAPTURE, it sets an extra intent parameter based on the actionCode passed in:

    takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
    

    According to the documentation for ACTION_IMAGE_CAPTURE:

    The caller may pass an extra EXTRA_OUTPUT to control where this image
    will be written. If the EXTRA_OUTPUT is not present, then a small
    sized image is returned as a Bitmap object in the extra field.

    So, because the EXTRA_OUTPUT parameter is being set, your image is being written to disk instead of being returned as data in the intent. To get the file location, you can inspect mCurrentPhotoPath which is written to before the intent is launched.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to scale down a image i get from photo library on
I'm trying to get as good an image as possible from the camera, but
Im trying to get an image from a wcf rest service like so: [ServiceContract]
I'm trying to get an image from URL and save it to the isolated
I am trying to get an image from URL in Android and set it
I am trying to get an image from an HTTP server using Perl. I
I'm trying to get an image off the internet from an URL in java.
Hi friends, I am trying to get the string data and image data from
OK, trying to get images from my SD card to show in an activity
I am trying to get an image from a website when inputted on 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.