Questions tagged [android-contentresolver]

A ContentResolver represents the connection between an app requesting data and the target ContentProvider.

A ContentResolver represents the connection between an app requesting data and the target ContentProvider. A typical way to access the ContentResolver is through the getContentResolver() method of an Activity.

1031 questions
0
votes
2 answers

Stopping a ContentProvider Request

I have a long running Content Provider, basically it is doing some searches in the cloud & returning a cursor w/ the results. My issue is that depending on the connection and load of the server. Results could take 5-7 seconds to return. It seems…
-1
votes
1 answer

Why is ContentResolver.query() returning duplicate entries from contacts?

So I'm reading in these contacts using Android's native implementation, using a test phone with about 1,056 contacts on it. The problem I'm having is that it's rather slow, so I'm logging the outcomes of my cursor.moveToNext(), and seeing that it's…
-1
votes
1 answer

Using contentResolver out of Mainactivity creates Null pointer exception getApplicationContext() on a null object reference

I'm trying to ContentResolver outside Mainactivity . Is there a way to access without null pointer exception ImageFragment.kt extends Appcompatactivity() Val uri=contentResolver.insert(MediaStore.images.Media.EXTERNAL_CONTENT_URI,value) Edit This…
-1
votes
1 answer

Getting wrong data when extracting details from contact in Android

I am trying to get the details from a selected contact and feed it back to my Fragment in an Observable. I get some data but it's not correct, for example i get just a "1" or a "3" as given name and date of birth as url/website. And some data isn't…
-1
votes
2 answers

How to use getContentResolver() inside non activity class?

I am trying to create a method which retrieves contact name for the given input string. For that I have to use getContentResolver method. To use the context I am passing the context as the parameter. But still the following error is…
deluxan
  • 372
  • 1
  • 5
  • 22
-1
votes
1 answer

Null object for cursor from getContentResolver()

I'm using SQLite in my Android app. I've encountered the problem when I'm using a cursor to display information. The cursor uses getContentResolver. I'm getting the error java.lang.RuntimeException: Unable to start activity…
sixcookies
  • 357
  • 1
  • 7
  • 22
-1
votes
2 answers

SMS Messages of a particular number not showing up on other devices Android

I am using the Telephony.Sms library to load in received and sent sms messages for the app I am working on. When I set the query selection to null (the third item in the query), it will show all the sent and received sms messages on the different…
-1
votes
2 answers

How to save SMS in android

I want to save SMS to inbox and I have implemented answers from here which were supposed to store message into inbox. But I'm unable to find the stored sms and no error or exception is thrown. Thanks
Olu Udeh
  • 1,031
  • 1
  • 10
  • 20
-1
votes
2 answers

Does the Content Resolver query retrieves all the data at once?

Does the Content Resolver query retrieves all the data at once? if so, how to optimize this to retrieve the data as the cursor moves? (is it possible at all? if not, how to optimize this process?)
-1
votes
1 answer

How to speed up the receipt of contacts from android phone?

I write code for getting contacts from phone book, but he works very slow, how i think. For example in samsung galaxy s8 for 189 phone numbers (each contact may have more than one number) average speed is 4582ms. 5 seconds! it's very slow how i…
abbath0767
  • 946
  • 2
  • 11
  • 31
-1
votes
1 answer

Using preset event colors of google calendar in ContentValues

Any way to use some of the preset colors provided by google calendar while creating events by configuring ContentValues. I tried using ContentValues event = new ContentValues(); event.put("eventColor", 0xffff3300); But this changes back to…
-1
votes
1 answer

_data column not available at FileProvider uri

I'm using the FileProvider pattern for creating content:// uri to files, with the FileProvider.getUriForFile(this, "com.myapp.provider", file) function. I have the manifest, provider_paths and everything set the standard way, It creates an uri…
tibbi
  • 249
  • 4
  • 27
-1
votes
1 answer

All Contacts are not showing while retrieving contacts

I implemented a code to retrieve all contacts but it is not showing all contacts where few of them are missed. Here is my code: String[] projection = new String[]{ ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, …
basha
  • 587
  • 2
  • 6
  • 25
-1
votes
2 answers

Cursor returns null when getting filepath from URI

Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; // Get the cursor Cursor cursor = getContentResolver().query(selectedImage, filePathColumn,…
-1
votes
1 answer

Load data from db using content provider

I am using content providers to store and retrieve data from Database. This is what happening in the app when user install the app. App start a service which will download data from server and store it in db App is using CursorLoader to load data…
1 2 3
68
69