android-contacts

Click event on EditText's drawableRight not working properly?

感情迁移 提交于 2019-12-11 01:58:20
问题 I need to open phone's contact book on the click of EditText 's drawableRight . Click event on drawableRight is working fine But the problem is, when I click/touch on anywhere on EditText it is also execute click event and open contact list. I take help for manage click event on drawableRight from here Please check this link. I don't want to open contact list when I click on EditText , I only want to open it when I click drawableRight (image). So how solve this problem? Here is my code:

Delete contact from android contacts

耗尽温柔 提交于 2019-12-11 01:45:17
问题 I am trying to delete a contact from phone contacts. The contact gets deleted from phone contacts but it's not getting deleted from the server-side (Google contacts) and when the Google contact sync triggers then that deleted contact re-appears. Below is my code. public static void deleteContact(long rawid, ContentResolver contentResolver) { ArrayList<ContentProviderOperation> ops = new ArrayList<>(); Uri uri = ContactsContract.RawContacts.CONTENT_URI .buildUpon() .appendQueryParameter(

How to delete contacts from sim in android

爷,独闯天下 提交于 2019-12-11 01:41:02
问题 I did following code for deleting selected contacts from sim card. but its not deleting and also not throwing any error. protected void DeleteContacts(ArrayList<String> ids){ int flg = 0; String[] strids = new String[ids.size()]; strids = ids.toArray(strids); for (int i = 0; i < strids.length; i++) { Cursor sims = getActivity().getContentResolver().query( Uri.parse("content://icc/adn"), null, "_id=?", new String[]{strids[i]}, null); sims.moveToFirst(); if (sims.getCount()>0) { String

Large Photo Version from contacts in android

我与影子孤独终老i 提交于 2019-12-11 01:28:23
问题 I am trying to fetch the larger size picture from my contacts using the following code: Uri my_contact_Uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(contactId)); InputStream photo_stream = ContactsContract.Contacts.openContactPhotoInputStream(getContentResolver(), my_contact_Uri); if(photo_stream != null) { BufferedInputStream buf =new BufferedInputStream(photo_stream); Bitmap my_btmp = BitmapFactory.decodeStream(buf); profile.setImageBitmap(my_btmp);

Get contact's mobile, work and home number in a string

独自空忆成欢 提交于 2019-12-11 01:13:50
问题 I want to get the contact's(Saved in phonebook) mobile number, work number and home number. I want to set these numbers in my 3 edittext views. How to do this? Here is my code Cursor phones = getActivity().getContentResolver().query( Phone.CONTENT_URI, null, Phone.CONTACT_ID + " = " + phoneId, null, null ); while (phones.moveToNext()) { number = phones.getString(phones.getColumnIndex(Phone.NUMBER)); int type = phones.getInt(phones.getColumnIndex(Phone.TYPE)); if (type == Phone.TYPE_HOME) {

Android contacts: How does the lookup key works?

拥有回忆 提交于 2019-12-10 20:01:25
问题 On top of contacts id , Android also got LOOK_UP key. Since id of contact can change, you can obtain user uri, using LOOK_UP key. public static Uri lookupContactUri(String lookup, Context context){ ContentResolver contentResolver = context.getContentResolver(); Uri lookupUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookup); return ContactsContract.Contacts.lookupContact(contentResolver, lookupUri); } But how does it work? The source code of the Contacts

android is CallLog.Calls._ID the same with the contact id?

吃可爱长大的小学妹 提交于 2019-12-10 19:17:56
问题 I created a log call list. I want to add the picture to each contact in ann imageview. I would like to ask if Cursor managedCursor = managedQuery(CallLog.Calls.CONTENT_URI, null, null, null, "DATE DESC"); int id = managedCursor.getColumnIndex(CallLog.Calls._ID); is the same with ContactsContract.Contacts._ID If this two are not the same how can I obtain the contact is using managedCursor? 回答1: No it isn't. It is just the ID of the row. Anyway you can read the phone number from the NUMBER

How to update a native contact photo on android?

Deadly 提交于 2019-12-10 17:11:01
问题 I am working on one sample application just to insert, update and delete the native android contact. I am able to successfully insert, update and delete the contact. But the problem in updating the contact photo. Below images are the observation where the same contact having two different issue. After updating the contact, first image is still displaying the old image. But where as when i view the full details i am able to view the newly updated contact image as shown in the second image.

Wrong reference to Contacts table from sms inbox

本秂侑毒 提交于 2019-12-10 13:59:16
问题 I am trying to find the contact details corresponding to an sms from the phone's sms inbox. From my understanding the person column is a foreign key to the _id column of ContactsContract.Contacts . My problem is that I am getting wrong values for the person value from the sms query. Some person ids don't exist in the contact table and some are pointing to totally different contact. Below is the code that I use for fetching the list of person values, Can anyone tell me if I missed something or

How do get the android sdk contact picker to give me just phone results and not all my twitter followers

风格不统一 提交于 2019-12-10 10:57:47
问题 i get some pretty weird stuff when i try and use this: Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, PICK_CONTACT); my problem is that this pulls back a very strange list, it appears to have every type of contact (i.e phones, emails, twitter, etc) as well as a huge list of "Unnamed" contacts and my number listed about 100 times. What i want is for it just to pull back the same list as when I hit the "phones" widget on my