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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:31:47+00:00 2026-06-13T11:31:47+00:00

I was wondering if it is possible to get the data which is present

  • 0

I was wondering if it is possible to get the data which is present in a content provider row directly in a cursor (or other container) in the case where I already know the row uri (in other words, I already have the ContentURIs with the row id appended).

Both an insert or a Content Observer OnChange (on android api 16) gives me back the inserted/changed URI and I would like to get the data from that row efficiently (without many queries or instructions). However, the only way I found was to parse the ID from the URI, build a query with a selection clause to that id and then get the cursor, as:

     long row = ContentUris.parseId(uri);
     String mSelectionClause = ContentProvider.Table._ID + " = ?";
     String[] mSelectionArgs = {Long.toString(row)};
     Uri other_uri = Uri.parse(ContentProvider.AUTHORITY_STRING + ContentProvider.UriPathIndex.Table);
     Cursor cursor = cr.query(other_uri ,null,mSelectionClause,mSelectionArgs,null);

Is there some other way of doing it? I was wondering if it was possible to directly use the row uri

  • 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-13T11:31:48+00:00Added an answer on June 13, 2026 at 11:31 am

    Citing from http://developer.android.com/guide/topics/providers/content-provider-basics.html#ContentURIs

    Many providers allow you to access a single row in a table by appending an ID value to the end of the URI. For example, to retrieve a row whose _ID is 4 from user dictionary, you can use this content URI:

    Uri singleUri = ContentUris.withAppendedId(UserDictionary.Words.CONTENT_URI,4);
    

    EDIT (from comments):
    It works for all the standardized content providers (at least those provided by Google). It will work for all content providers which follow the design guidelines for content providers backed up by a row-based data store.

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

Sidebar

Related Questions

I was wondering if it's possible to get the frequencies present in a file
I am wondering if its possible to get $(this).scrollTop() value after an anchor jump.
I am wondering if it´s possible to get the IP address of the airplay
I was wondering if it is possible to get the places of interest in
I'm wondering if it's possible to get the address of an individual element of
What I'm wondering is if it is possible to get the bare metal C++
I'm wondering if it is at all possible to get the total duration of
Hey all, I'm just wondering if it is possible to get the name of
I was wondering if there was any possible way to get the number (count)
Simple question: Is it possible to get all the data POSTed to a page,

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.