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 6077899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:46:22+00:00 2026-05-23T10:46:22+00:00

I have an activity which allows me to take an image with the camera,

  • 0

I have an activity which allows me to take an image with the camera, and I want to send this image to the parent activity as an Intent extra. However, if I actually try to add the image to the intent, all of a sudden the finish() call never seems to do anything and my activity never closes.

Here’s some of my code:

    public void onPictureTaken(byte[] imageData, Camera c)
    {
        if (imageData != null) {
            // Send the result as a byte array
            Intent intent = new Intent();
            intent.putExtra("imagedata", imageData);
            setResult(RESULT_OK, intent);
            finish();
        }
    }

The odd thing is, if I comment out the putExtra() call then it all works properly (without the image, of course) and my activity closes and I hit the parent’s onActivityResult() callback. But if I leave the line in, then the activity never closes and the callback never fires.

I’ve tried putting more trivial things in the extras, like strings, and it’s all worked perfectly. putExtra() is allowed to take a byte array and I’ve even tried wrapping it up as a Bitmap and sending that, but it didn’t work either. The only thing I can think of is that I’m just not supposed to pass something that big into an Intent, in which case I guess I’ll just try writing it to a file instead. It’s just that writing is to a file should be slower than just passing the byte array reference around, which is why I’m trying to do it this way.

Any ideas? Thanks in advance 🙂

Phone: Samsung Galaxy S
API level: 7

  • 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-23T10:46:23+00:00Added an answer on May 23, 2026 at 10:46 am

    You shouldn’t be including your image data within the Intent extras. See this thread for clarification. In a nutshell, keep your Intent extras as small as possible.

    I would suggest storing your picture to the SD card, and passing the path to this file in your Intent.

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

Sidebar

Related Questions

I have to build a feature in my application which allows user to send
I have this textbox in the other activity and a button which leads to
I have an activity which shows some List entries. When I click on a
I have created an activity which sends a number of notifications to status bar.
I have a couple of tables which are used to log user activity for
Say if I have a locationManager(LM) object in activity A, which is my main
I have a custom activity, with a single in argument which is a string.
I have an Activity which lets the user input names and the save them.
I have an alert dialog being popped, which allows a person to enter a
Facebook finally allows to fetch the activity stories of a user (which means these

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.