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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:29:11+00:00 2026-05-28T05:29:11+00:00

Based on code suggestions here at stackoverflow, I’ve tried to extract an image from

  • 0

Based on code suggestions here at stackoverflow, I’ve tried to extract an image from the MediaStore. However, when I select an actual photo, getContentResolver().query() always returns null. I can’t understand why…

Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(i, SELECT_PHOTO);

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.v(TAG,"onActivityResult: requestCode = "+requestCode+", resultCode = "+requestCode);
    if (requestCode == SELECT_PHOTO) {
        Uri selectedImage = data.getData();
        String[] filePathColumn = {android.provider.MediaStore.Images.Media.DATA};
        Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
        if (cursor != null) {
            Log.v(TAG,"onActivityResult: count = "+cursor.getCount());
            if (cursor.getCount() == 1) {
                cursor.moveToFirst();
                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                String filePath = cursor.getString(columnIndex);
                Log.v(TAG,"onActivityResult: filePath = "+filePath);
            }
            cursor.close();
        }
    }
}
  • 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-28T05:29:11+00:00Added an answer on May 28, 2026 at 5:29 am

    try restart your emulater or your device(or uninstall/install the SD card)?
    somebody tell me the Android System will scan the medias when restart or reload SD card…maybe the database hasn’t change.

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

Sidebar

Related Questions

Based on suggestions from svick, I believe I can substancially simplify my post and
I have a custom (code-based) workflow, deployed in WSS via features in a .wsp
In standard php or source code based projects we easily keep all of the
I have the following HTML code based on a tab menu format, i.e: <div
I am currently running the following code based on Chapter 12.5 of the Python
I would like to enable/disable some code based on a custom solution configuration I
I am using CodeDom to generate dynamic code based on user values. One of
Using T4 I want to generate some code based on examining what files are
I'm looking at writing a tool for generating code based on the contents of
I am in the process of writing some validation code based on these assumptions:

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.