android-contentresolver Questions

3

MediaStore.MediaColumns.DATA constant was deprecated in API level Q. Apps may not have filesystem permissions to directly access this path. Instead of trying to open this path directly, apps shoul...
Komsomol asked 22/4, 2019 at 14:43

21

Solved

Before KitKat (or before the new Gallery) the Intent.ACTION_GET_CONTENT returned a URI like this content://media/external/images/media/3951. Using the ContentResolver and querying for MediaStore....

11

I tried a solution (see below) that works fine, except in Android 4.4 the call to startActivityForResult() brings up an activity titled "Open from", which has "Recent", "Images", "Downloads" as wel...
Ahmed asked 14/11, 2013 at 18:18

7

Solved

This topic has been discussed in lots of questions here, with mostly different results and, due to API changes and different types of URIs, no definitive answer. I don’t have an answer myself, but...
Cowgill asked 9/1, 2016 at 17:43

4

Solved

UPDATE: I have to completely change my question since I found more details related to my problem. The problem: My app that resolves Content Provider doesn't work in Emulator with API 30. The error:...
Amperage asked 24/8, 2020 at 15:24

2

I have implemented the selection of contacts from the phone book in my application. In order for the intent with action PICK to work on android 11, I added this to my manifest: <queries> &l...
Horseshit asked 29/9, 2020 at 12:45

3

I am trying to find method which can handle create and copy of any file except Media files (Picture/Video/Audio) to copy from one place to other in internal storage in Android Q. In this I have my ...
Alagoas asked 28/12, 2019 at 13:2

4

Bounty Award - The bounty will be awarded to an answer that gets from a populated Telephony.Sms.Inbox.PERSON value, to the associated Contact using only ContractsContact tables. I'm reading SMS ...
Feathery asked 5/1, 2017 at 21:31

5

Solved

My intention is to display the contacts in sorting order using content resolver in android. For that I'm writing: Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, C...
Fresh asked 11/12, 2012 at 6:24

6

Solved

I am trying to have a contentprovider , but I am having trouble because I am getting an error of "Failed to find provider info for com.example.alex.hopefulyworks" Here is the manifest and the cont...

3

According to the official docs at https://developer.android.com/guide/components/intents-common#Contacts You can use a pick intent public void selectContact() { Intent intent = new Intent(Intent...

2

I'm trying to get the file path for a content URI. URL looks like this: content://com.android.providers.downloads.documents/document/31 The cursor object is not null but the cursor.getString(colu...
Bassarisk asked 11/6, 2014 at 1:4

3

Crash : java.lang.IllegalArgumentException Volume external_primary not found When querying for tracks from media store, I am getting this crash in some Android 10 devices (Most of them are from Xia...

3

When I try to delete an image that has been contributed/owned by my app it can be deleted easily. But for shared media inside the Pictures folder that my app has not owned, I show users a prompt by...

2

Solved

BACKGROUND I am reading this tutorial on Android Content Providers. I understand from this tutorial that, In order for other applications to access a Content Provider's data, the provider applica...

1

In Android 12, this method call takes multiple seconds to return: val descriptor = contentResolver.openAssetFileDescriptor(rootUri, "r") I'm passing it a tree Uri which represents the ro...
Crucify asked 18/11, 2021 at 10:40

5

Solved

I'm trying to test class that queries content resolver. I would like to use MockContentResolver and mock query method. The problem is that this method is final. What should I do? Use mocking fra...
Menis asked 7/7, 2011 at 12:17

11

Solved

What would be the correct way to add DISTINCT and/or GROUPBY to ContentResolver-based queries? Right now I have to create custom URI for each special case. Is there a better way? (I still progra...
Columbus asked 22/2, 2010 at 23:54

3

I tried lot of snippets. This is what I'm using now. I know that MediaStore.Video.Media.DATA is deprecated.somehow this method is working on android 10 as well but sometimes it throws android.data...
Gael asked 25/7, 2020 at 5:41

5

Solved

Expected Behavior When I am selecting the file which is stored inside "Download", it should able to retrieves its file name and path Actual Behavior When I am selecting the file which is stored ...

0

java.lang.IllegalArgumentException: Unknown URL content://media/external/images/media at android.content.ContentResolver.insert(ContentResolver.java:1837) with some device.where the faulty device...
Maas asked 1/11, 2020 at 15:7

1

Solved

I added files to Documents/MyExcelsFolder by using ContentResolver.insert and then also added new file to Documents/MyExcelsFolder folder by another app (for ex. FileManager) Then I try to get all ...
Purgation asked 9/10, 2020 at 8:53

0

The problem is as follows. I have a working SyncAdapter and ContentResolver setup. The problem that SyncAdapters onPerformSync is not triggered happens when I have wifi turned on but the wifi does ...

2

I am picking an image from the gallery and querying its size via ContentResolver API, it returns 29kb. However when I check the file via adb using ls -al it is 44kb here is how I query the size o...
Lifton asked 17/1, 2018 at 14:2

6

I'm trying to load a Contact photo with URI "content://com.android.contacts/contacts/295" by using Glide. When I use Glide.with(context).load(Uri.parse(contactPhoto).into(imageview) Glide gives...

© 2022 - 2024 — McMap. All rights reserved.