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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:33:59+00:00 2026-06-16T00:33:59+00:00

Got a problem here with a simple section of code that uses managedQuery cursors.

  • 0

Got a problem here with a simple section of code that uses managedQuery cursors. Two parts, the top half of the code puts a string into the LATITUDE column of the MediaStore database content provider.

The second part of the code below that reads that same string back from the database. This is where it is returning a null result. Either because the string was not correctly read into the database in the first part of the code or there is an error in the second part where it reads it back from the database.

I am using the LATITUDE column of the Media.images content provider to store a string. There is no other unused column that is available so that is why I am using it.
The goal is to put the string path name of the mp3 file into the LATITUDE column of an image and read it back out again later with another query.

I tracked down the problem to the following code. The cursor in the second part of code is returning null. Is there something wrong with my use of cursors, or some error in this that I don’t know about?

  String displayName; // string pathname of the mp3 file to be put into LATITUDE column
  String filename; // the pathname of the image that I want to add the database info to

  ContentValues imageValues = new ContentValues();
  String selection3 = MediaStore.Images.Media.DATA + "='" + filename +"'";
  imageValues.put(MediaStore.Images.Media.LATITUDE, displayName);
  getContentResolver().update(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
  imageValues, selection3, null);

  String[] proj6 = { MediaStore.Images.Media.LATITUDE };
  String selection6 = MediaStore.Images.Media.DATA + "='" + filename +"'";
  Cursor cursor2 = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
  proj6, selection6, null, null);
   cursor2.moveToFirst();        
  String displayer = (String)
  cursor2.getString(cursor2.getColumnIndex(MediaStore.Images.Media.LATITUDE));
  • 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-16T00:34:00+00:00Added an answer on June 16, 2026 at 12:34 am

    Found out that there was not an error like I thought it would be. It was only a typing error.

    put method has “Images.Media.LATITUDE”
    update method has “Audio.Media.LATITUDE”, changed this to “Images.Media.LATITUDE” like it is in the put method and it works now.

      imageValues.put(MediaStore.Images.Media.LATITUDE, displayName);
      getContentResolver().update(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
      imageValues, selection3, null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a quite strange problem here. I'm calling some simple code via Ajax.Updater:
I want to ask about strcpy. I got problem here. Here is my code:
I've got problem with my simple apliccation. I don't want paste tons of code.
I've got an interesting box-model problem here. I have a header full of links,
Can't understand what is a problem here: I have got main.cpp file where I
Here i got a problem in my script, Once we set one radio button
Got a problem which to me make no sense. So here goes: I have
I got the problem with the cancel button of MFMailComposeViewController. Here is my context
I've got a problem using different layouts for list items in my project. Here
I've got a weird problem: both my if and else statements are executing. Here's

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.