contacts

How do I display a contact's photo from the contact's id?

为君一笑 提交于 2019-12-20 04:15:09
问题 This code (within my CustomAdapter class) displays only the contact id based on the who sent me text messages and puts them into an ArrayList, then displays the list. I have a ImageView called holder.photo next to each contact id. How would I go about displaying the contact's photo in the in the ImageView? String folder = "content://sms/inbox/"; Uri mSmsQueryUri = Uri.parse(folder); messages = new ArrayList<String>(); contactID = new ArrayList<String>(); SMS = new ArrayList<String>(); try { c

Retrieve System Default Android Contact Picture

有些话、适合烂在心里 提交于 2019-12-20 01:36:17
问题 I know this may sound strange, but I want to retrieve the system default contact picture. You know, that icon that's used when there is no picture for the contact. It differs between different versions of Android, but it's generally a blank face, or a grey android, or whatever. Can I get that image from the system and use it in my app? 回答1: You can find them in the drawable folder of the resources that come with the emulator. \android-sdk\platforms\android-v#\data\res\drawable\ 回答2: I dont

How to tell ABPeoplePickerNavigationController to list only contacts that have an email address?

我的未来我决定 提交于 2019-12-19 19:15:24
问题 I want my users to fill an email field by selecting a contact's email from their address books. I don't want them to scroll all the contacts whose emails are not set, so I want to filter the ones that have email addresses. This is the code I've written so far. I can figure out who has an email address and who has not but I couldn't tell the ABPeoplePickerNavigationController to list only the right contacts. Is it impossible to achieve this, I mean do I have to implement my own contact picker

Open device contacts list at button click event

情到浓时终转凉″ 提交于 2019-12-19 09:58:18
问题 How can i open Android device contacts list at button click event. 回答1: Try this code.. yourButton.setOnClickListener(new YouButtonEvent()); class YouButtonEventimplements OnClickListener{ @Override public void onClick(View v) { Intent it= new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(it, PICK_CONTACT); } } 回答2: Declare Some variables. Create a method & handle the events. private static final int CONTACT_PICKER_RESULT = 1001; private static final String DEBUG

Open device contacts list at button click event

北战南征 提交于 2019-12-19 09:58:01
问题 How can i open Android device contacts list at button click event. 回答1: Try this code.. yourButton.setOnClickListener(new YouButtonEvent()); class YouButtonEventimplements OnClickListener{ @Override public void onClick(View v) { Intent it= new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(it, PICK_CONTACT); } } 回答2: Declare Some variables. Create a method & handle the events. private static final int CONTACT_PICKER_RESULT = 1001; private static final String DEBUG

how to retrieve the list of contacts in android

半城伤御伤魂 提交于 2019-12-19 03:57:02
问题 my purpose to retrieve the list of contacts (name, number) is recorded in a json object, to send via web service to the server then I found the code to visit contacts, and it is good, I test this code String id, name; ContentResolver crs = getContentResolver(); Cursor people = crs.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); String phone = ""; people.moveToPosition(Contexts.getnbContacts()); while (people.moveToNext()) { id = people.getString(people .getColumnIndex

How to know which specific contact was updated in android?

Deadly 提交于 2019-12-19 03:25:23
问题 I am able to get a generic notification "that there was a change to the contacts DB", but I want to know the specific record that was inserted, updated, or deleted. I don't want to use Look-up URI concept because I don't want to set look-up URI for every contact individually. I want a generic solution that I can know when any contact is updated or deleted. 回答1: You can implement an Service to watch the database status. import android.app.Service; import android.content.Intent; import android

Error:Error: Found item String/photoPickerNotFoundText more than one time

一笑奈何 提交于 2019-12-18 16:11:54
问题 I'm trying to import this project in Android Studio 1.0.1 https://github.com/android/platform_packages_apps_contacts When I build the app it shows these two errors: * Error:Execution failed for task ':app:mergeDebugResources'. * C:\Users\vinz\AndroidStudioProjects\platform_packages_apps_contacts-master\app\src\main\res\values\strings.xml: Error: Found item String/photoPickerNotFoundText more than one time I wonder what's wrong in this source code provided by Google. I've tried removing the

How do implicit joined columns work with Android contacts data?

微笑、不失礼 提交于 2019-12-18 14:10:53
问题 I'm querying the ContactsContract.Data table to find phone records. I get an error when I create a new CursorLoader : java.lang.IllegalArgumentException: Invalid column deleted My code: import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Data; ... String[] projection = { Phone.DELETED, Phone.LOOKUP_KEY, Phone.NUMBER, Phone.TYPE, Phone.LABEL, Data.MIMETYPE, Data.DISPLAY_NAME_PRIMARY }; // "mimetype = ? AND deleted = ?" String selection =

How do implicit joined columns work with Android contacts data?

这一生的挚爱 提交于 2019-12-18 14:10:01
问题 I'm querying the ContactsContract.Data table to find phone records. I get an error when I create a new CursorLoader : java.lang.IllegalArgumentException: Invalid column deleted My code: import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Data; ... String[] projection = { Phone.DELETED, Phone.LOOKUP_KEY, Phone.NUMBER, Phone.TYPE, Phone.LABEL, Data.MIMETYPE, Data.DISPLAY_NAME_PRIMARY }; // "mimetype = ? AND deleted = ?" String selection =