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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:15:06+00:00 2026-05-27T00:15:06+00:00

I’ve made a app with two buttons one to select an image from the

  • 0

I’ve made a app with two buttons

  • one to select an image from the gallery
  • one to take a new image with the camera

The process for the gallery select works fine, if I take a picture with the camera it keep getting Failure delivering result ResultInfo error. And it seems the image is not writen to the folder.

Since both return the same I have one handler to cope with the result;

protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
        if (requestCode == 1) {  
            if (resultCode == RESULT_OK && data.getData() != null){
                try {
                    Log.i("YADDA",data.getData().toString());
                    Uri targetUri = data.getData();
                    if (targetUri != null) {
                        //Log.i("YADDA",targetUri.toString());
                        myImage nsi = new myImage();
                        nsi.ThumbNail = getThumbnail(targetUri);
                        nsi.path = targetUri;
                        nsi.FileName = FileNameBase + "_" +     String.valueOf(1 + photos.size());
                        photos.add(nsi);
                    }

                } catch (IOException e) {
                    e.printStackTrace();
                }

                DrawImageGallery();
            }
        }

The Button handlers;

    nsbu1.setOnClickListener(new Button.OnClickListener() {
         public void onClick(View v){
             Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
             photoPickerIntent.setType("image/*");
             startActivityForResult(photoPickerIntent, 1);
        }
    });

    nsbu2.setOnClickListener(new Button.OnClickListener() {
         public void onClick(View v){
             Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                 // Uri myuri=Uri.fromFile(new     File(Environment.getExternalStorageDirectory().getAbsolutePath(), FileNameBase + ".jpg"));
                 Uri myuri=Uri.fromFile(new File("/mnt/sdcard/tmp/" + FileNameBase + ".jpg"));

                 Log.i("YADDA", myuri.toString());
                 intent.putExtra(MediaStore.EXTRA_OUTPUT, myuri );

                 startActivityForResult(cameraIntent, 1);  
            }
        });

Things I tried:

  • I’ve double checked the, manifest for write permissions on the SDcard
  • wierd thing is, the handler must be correct, because a picture from gallery works fine
  • Some version of android have a bug with this camera handler, but I’ve check, my Nexus S has is not one of them.
  • googled/debugged for hours and hours

Logcat output;

 09-01 10:02:59.085: ERROR/AndroidRuntime(1898): FATAL EXCEPTION: main
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity {com.android.spot/com.android.spot.newsite}: java.lang.NullPointerException
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2532)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:2574)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.ActivityThread.access$2000(ActivityThread.java:117)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.os.Handler.dispatchMessage(Handler.java:99)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.os.Looper.loop(Looper.java:130)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.ActivityThread.main(ActivityThread.java:3683)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at java.lang.reflect.Method.invokeNative(Native Method)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at java.lang.reflect.Method.invoke(Method.java:507)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at dalvik.system.NativeStart.main(Native Method)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898): Caused by: java.lang.NullPointerException
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at com.android.spot.newsite.onActivityResult(newsite.java:351)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.Activity.dispatchActivityResult(Activity.java:3908)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2528)
 09-01 10:02:59.085: ERROR/AndroidRuntime(1898):     ... 11 more
  • 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-27T00:15:06+00:00Added an answer on May 27, 2026 at 12:15 am

    I just helped a person with the same error on the PhoneGap issue list. I believe you are missing the permission:

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

    from your AndroidManifest.xml file. We need to be able the write the captured image out to a .jpg file.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

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.