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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:51:12+00:00 2026-06-11T19:51:12+00:00

I am having weird problem, I am having a user click button to choose

  • 0

I am having weird problem, I am having a user click button to choose an image. Then I am storing the encoded path in db and retreiving it later so I display the image in another activity but I am getting the following Exception

09-14 01:39:36.195: W/System.err(2241): java.io.FileNotFoundException: No content provider: /external/images/media/1113
09-14 01:39:36.195: W/System.err(2241):     at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:610)
09-14 01:39:36.195: W/System.err(2241):     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:542)
09-14 01:39:36.195: W/System.err(2241):     at android.content.ContentResolver.openInputStream(ContentResolver.java:377)

My button OnClick & store in db code:

                Uri selectedImage = imageReturnedIntent.getData();
                InputStream imageStream;
                try {
                    imageStream = getContentResolver().openInputStream(selectedImage);
                    BitmapFactory.Options options=new BitmapFactory.Options();
                    options.inSampleSize = 8;
                    Bitmap yourSelectedImage = BitmapFactory.decodeStream(imageStream, null, options );
                    ivPictureChosen.setImageBitmap(yourSelectedImage);
                    storeEncodedImageInDb(selectedImage.getEncodedPath());
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    Toast.makeText(this, "Couldn't pick image", Toast.LENGTH_SHORT).show();
                }

My retreival & showing image code:

            String imagePath = db.getEncodedImage();
            if(imagePath.length()>0){
                Uri mainImgeUri = Uri.parse(imagePath);
                InputStream imageStream;
                try {
                    imageStream = getContentResolver().openInputStream(mainImgeUri);
                    BitmapFactory.Options options=new BitmapFactory.Options();
                    options.inSampleSize = 8;
                    Bitmap yourSelectedImage = BitmapFactory.decodeStream(imageStream, null, options );
                    mainImage.setImageBitmap(yourSelectedImage);
                } catch (FileNotFoundException e) {

                    e.printStackTrace();
                }
            }

How come the file is not found although thats the encoded path I got in the first place?

  • 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-11T19:51:13+00:00Added an answer on June 11, 2026 at 7:51 pm

    You will not only need the path but also scheme etc.
    An Uri looks like so: http://www.stackoverflow.com or file://foo/bar/image.jpg.

    encodedPath is only the path part of this, e.g. stackoverflow.com or /foo/bar/image.jpg.

    Try to store the result of yourUri.toString() in the database and retrieve Uri.parse(theStringFromDatabase)

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

Sidebar

Related Questions

I'm having a rather weird problem (I think). The user can add a contact
Probably this is another user error, but I'm having a weird problem with this.
Having a weird problem sprintf(tmp, \%s\, filename); I expect the output to be filename
i'm having a weird problem about copying with Xcopy. I'm using Windows Server 2008
I'm having the weird problem that after having javascript inject some dom-elements the css-rules
I'm having a weird problem with the following function, which returns a string with
I'm having a weird problem with memset, that was something to do with a
I'm having a weird problem with index organized table. I'm running Oracle 11g standard.
I am having a weird problem with sending data back to my server. This
I am having a weird problem where lots of ^M characters show up in

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.