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
-1
votes
1 answer

contentResolver not returning distinct data from MediaProvider

I have this function, which is supposed to give the list of albums or buck_display_name(s) but it is returning repeated value. I have searched a lot but could not find any help: String[] projection = {"Distinct "+MediaStore.Images.Media.BUCKET_ID, …
Imran Aslam
  • 208
  • 2
  • 15
-1
votes
1 answer

Unable to fetch Phone contact on and above Api 5.0 (Lollipop & Marshmallow)

I am trying to fetch email and display name from contact list. My code is working fine till api level 4.4 (Kitkat) but not on 5.0 Lollipop or above (6.0 Marshmallow). Here is my code : public ArrayList getEmailDetails(){ …
Harry
  • 369
  • 2
  • 17
-1
votes
1 answer

Meaning and Purpose of " = '1' " in ContentResolver Query

String selection = ContactsContract.Contacts.HAS_PHONE_NUMBER " + " = '1''"; String[] selectionArgs = String.valueOf(1); Why do we put " = '1' " in the Selecion Query ? and Also the Reason for String.valueOf(1);
-1
votes
1 answer

How can I access ANDROID_ID in library code?

I want to access the value of Settings#ANDROID_ID in a library code. I found that [Secure#getString](http://developer.android.com/reference/android/provider/Settings.Secure.html#getString(android.content.ContentResolver, java.lang.String)) requires…
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
-1
votes
1 answer

Importing contacts from addressbook in android is slow?

I have written code for importing all the contacts with details (Name,Mobile number,DOB,anniversary and email address) from device addressbook to my application database.The code is running fine and getting all details but its a very slow process…
Anshul
  • 7,914
  • 12
  • 42
  • 65
-1
votes
2 answers

reading specific contact information

I'm currently doing development on an Android app that requires me to read all the contacts on a device and select only specific contacts based on criteria (only contacts that have at least one valid mobile number and all email addresses linked to…
-1
votes
1 answer

updating phone contact not working

I'm tryingt ot extract my contacts and apply so changes on them but the problem is that my builder seems like it's working fine and not throwing any exception but there are no changes ! Cursor c; ArrayList ops = new…
-1
votes
1 answer

showing error during debugging

I have a method call in onReceive method. public void onReceive(Context context, Intent intent) { SaveCallLog(); } public boolean SaveCallLog() { info = new TelephonyInfo(); imei1 = info.getImeiSIM1(); imei2 =…
Anjali
  • 206
  • 3
  • 10
-2
votes
1 answer

Why MediaStore.Images.Media give me only BitMap while on the phone images are JPG

I'm "playing" with MediaStore.Images.Media and I saw that I can only retrieve BMP format (MediaStore.Images.Thumbnails.getThumbnail() - MediaStore.Images.Media.getThumbnail()), while the same images on my device actually are JPG. I didn't find any…
MDP
  • 4,177
  • 21
  • 63
  • 119
-2
votes
1 answer

Force close on reading group SMS

Hi I am developing an android SMS app and fetching the SMS from built in messaging app as Uri uriSMSURI = Uri.parse("content://mms-sms/conversations?simple=true"); Cursor cursor = getContentResolver().query(uriSMSURI, new String[] {"*"},…
sanjana
  • 641
  • 2
  • 15
  • 36
-3
votes
3 answers

IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it

I am new to android. I am implementing music player using service. Here is the code in which error is focused. Can anyone help me out to solve this error? public void getSong() { ContentResolver contentResolver = getContentResolver(); Uri…
1 2 3
68
69