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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:21:34+00:00 2026-06-18T03:21:34+00:00

Problem: I am getting camera intent’s data null in onActivityResult(int requestCode, int resultCode, Intent

  • 0

Problem: I am getting camera intent’s data null in onActivityResult(int requestCode, int resultCode, Intent data) in Samsung S3. But working well on some other devices. I customized my code for getting data and searched this issue in web but nothing found useful.

Code :

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (requestCode == TAKE_CAMERA && data != null && data.getData() != null)  

           else if (requestCode == TAKE_CAMERA) {
        if (resultCode != RESULT_OK) return;
        Intent intent = new Intent("com.android.camera.action.CROP");
        intent.setDataAndType(tempFileUri, "image/*");

        intent.putExtra("outputX", 90);
        intent.putExtra("outputY", 90);
        intent.putExtra("aspectX", 1);
        intent.putExtra("aspectY", 1);
        intent.putExtra("scale", true);
        intent.putExtra("return-data", true);
        startActivityForResult(intent, CROP_CAMERA);
    } else if (requestCode == CROP_CAMERA && data != null) {
        Bitmap photo = data.getExtras().getParcelable("data");
        try {
            FileOutputStream out = new FileOutputStream(tempFileUri.getPath());
            photo.compress(Bitmap.CompressFormat.JPEG, 90, out);
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (photo != null) {
            imagePhoto.setImageBitmap(photo);

            <my code>
        }

    }
  • 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-18T03:21:35+00:00Added an answer on June 18, 2026 at 3:21 am

    I have Faced the Same Issue and got Work around with Below Way it will definitely help you tr it out once :

    For the Solution i have referred below link for solve the issue :

    Camera Solution for Samsung Galaxy S3

    Write the Below Code While calling captured image :

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(intent, PICK_FROM_CAMERA);
    

    And Get your URI by Below way inside OnActivityResult() Method:

    if (resultCode != RESULT_OK)
                return;
    
            switch (requestCode) {
            case PICK_FROM_CAMERA:
                Log.i("TAG", "Inside PICK_FROM_CAMERA");
    
    
                // Describe the columns you'd like to have returned. Selecting from
                // the Thumbnails location gives you both the Thumbnail Image ID, as
                // well as the original image ID
    
                try {
                    Log.i("TAG", "inside Samsung Phones");
                    String[] projection = {
                            MediaStore.Images.Thumbnails._ID, // The columns we want
                            MediaStore.Images.Thumbnails.IMAGE_ID,
                            MediaStore.Images.Thumbnails.KIND,
                            MediaStore.Images.Thumbnails.DATA };
                    String selection = MediaStore.Images.Thumbnails.KIND + "=" + // Select
                                                                                    // only
                                                                                    // mini's
                            MediaStore.Images.Thumbnails.MINI_KIND;
    
                    String sort = MediaStore.Images.Thumbnails._ID + " DESC";
    
                    // At the moment, this is a bit of a hack, as I'm returning ALL
                    // images, and just taking the latest one. There is a better way
                    // to
                    // narrow this down I think with a WHERE clause which is
                    // currently
                    // the selection variable
                    Cursor myCursor = this.managedQuery(
                            MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
                            projection, selection, null, sort);
    
                    long imageId = 0l;
                    long thumbnailImageId = 0l;
                    String thumbnailPath = "";
    
                    try {
                        myCursor.moveToFirst();
                        imageId = myCursor
                                .getLong(myCursor
                                        .getColumnIndexOrThrow(MediaStore.Images.Thumbnails.IMAGE_ID));
                        thumbnailImageId = myCursor
                                .getLong(myCursor
                                        .getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID));
                        thumbnailPath = myCursor
                                .getString(myCursor
                                        .getColumnIndexOrThrow(MediaStore.Images.Thumbnails.DATA));
                    } finally {
                        // myCursor.close();
                    }
    
                    // Create new Cursor to obtain the file Path for the large image
    
                    String[] largeFileProjection = {
                            MediaStore.Images.ImageColumns._ID,
                            MediaStore.Images.ImageColumns.DATA };
    
                    String largeFileSort = MediaStore.Images.ImageColumns._ID
                            + " DESC";
                    myCursor = this.managedQuery(
                            MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                            largeFileProjection, null, null, largeFileSort);
                    String largeImagePath = "";
    
                    try {
                        myCursor.moveToFirst();
    
                        // This will actually give yo uthe file path location of the
                        // image.
                        largeImagePath = myCursor
                                .getString(myCursor
                                        .getColumnIndexOrThrow(MediaStore.Images.ImageColumns.DATA));
                        mImageCaptureUri = Uri.fromFile(new File(
                                largeImagePath));
    
                    } finally {
                        // myCursor.close();
                    }
                    // These are the two URI's you'll be interested in. They give
                    // you a
                    // handle to the actual images
                    Uri uriLargeImage = Uri.withAppendedPath(
                            MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                            String.valueOf(imageId));
                    Uri uriThumbnailImage = Uri.withAppendedPath(
                            MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
                            String.valueOf(thumbnailImageId));
    
                    // I've left out the remaining code, as all I do is assign the
                    // URI's
                    // to my own objects anyways...
                } catch (Exception e) {
    
                    Log.i("TAG",
                            "inside catch Samsung Phones exception " + e.toString());
    
                }
    
    
                try {
    
                    Log.i("TAG", "URI Normal:" + mImageCaptureUri.getPath());
                } catch (Exception e) {
                    Log.i("TAG", "Excfeption inside Normal URI :" + e.toString());
                }
    
                //doCrop();
    
                break;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem getting password_Reset_confirm bit working. url: (r'^password_reset/$', 'django.contrib.auth.views.password_reset'), (r'^password_reset_done/$', 'django.contrib.auth.views.password_reset_done'), (r'^password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
I am getting 3 camera input to MATLAB with Infinite Trigger. But after minutes,
I have a problem getting my change(s) to data object retrieved using NHibernate to
I'm trying to open android's own camera application from my application.It is working!But i
I am getting problem in saving a cropped image taken from camera at specified
I have a strange problem getting the color of the point that was touched.
I am having a problem getting Twitter Bootstrap Carousel to begin looping automatically at
I'm having a problem getting a simple ASP.NET webpage to display. The page contains
I have a problem getting the right Price for a product based on Effectivity
I'm having a problem getting a change event to register with the following code:

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.