contacts

Adding an item to the Context Menu

大城市里の小女人 提交于 2020-01-06 14:51:08
问题 I wish to add an option of 'SEND' to the context menu of Contacts. Is it possible to extend the ContextMenu Activity? or is there any other option for the same? 回答1: Is it possible to extend the ContextMenu Activity? ContextMenu is not an Activity , and you cannot modify the context menu of another application. 来源: https://stackoverflow.com/questions/3615772/adding-an-item-to-the-context-menu

how to convert a CNPhoneNumber to string in swift4?

痴心易碎 提交于 2020-01-06 11:22:58
问题 I am using this code for getting contact number from contacts app but when I want to show the number in label I get this warning and doesn't work: Cast from 'CNPhoneNumber' to unrelated type 'String' always fails func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) { contacts.forEach {(contact) in for number in contact.phoneNumbers{ let phone = number.value print(phone) numberLabel.text = phone as! String } } } 回答1: TRY : if let phone = number.value as?

how to convert a CNPhoneNumber to string in swift4?

六月ゝ 毕业季﹏ 提交于 2020-01-06 11:22:29
问题 I am using this code for getting contact number from contacts app but when I want to show the number in label I get this warning and doesn't work: Cast from 'CNPhoneNumber' to unrelated type 'String' always fails func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) { contacts.forEach {(contact) in for number in contact.phoneNumbers{ let phone = number.value print(phone) numberLabel.text = phone as! String } } } 回答1: TRY : if let phone = number.value as?

how to convert a CNPhoneNumber to string in swift4?

只愿长相守 提交于 2020-01-06 11:22:20
问题 I am using this code for getting contact number from contacts app but when I want to show the number in label I get this warning and doesn't work: Cast from 'CNPhoneNumber' to unrelated type 'String' always fails func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) { contacts.forEach {(contact) in for number in contact.phoneNumbers{ let phone = number.value print(phone) numberLabel.text = phone as! String } } } 回答1: TRY : if let phone = number.value as?

Accessing the phonebook on Galaxy S crashes the app

自作多情 提交于 2020-01-06 07:12:50
问题 Does anyone know how to access the contacts from the Galaxy S? I have this line of code: Intent intent = new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI); startActivity(intent); and it works on the emulator as well as on the Samsung i5700. I tried running my app on Samsung i9000 (Galaxy S) but it crashes. I am getting the following error from LogCat: 08-23 11:28:19.511: INFO/ActivityManager(2234): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android

android update contact name

非 Y 不嫁゛ 提交于 2020-01-06 05:23:29
问题 I need to update a contact name but i didn't way the way to do that with the old contact api (my application must work in 1.5,1.6 AND 2.X) 回答1: Ahan well do something like this Intent i = new Intent(Intent.ACTION_EDIT); i.setData(Uri.parse("content://com.android.contacts/raw_contacts/1)); //Here 1 is the id of the contact to edit. You can also generate it automatically. startActivity(i); If you mean at runtime you want to select id from an text box , you can do something like Intent i = new

How to read call log history of a device in android in 6.0

[亡魂溺海] 提交于 2020-01-05 04:18:13
问题 My main aim of the app is to read the call history of the device and show it to the user using recyclerview and cardview. But When i run on marshmallow device app getting force close. Here is the code that i have used to read call history and the error that i got, when i run on 6.0 My MainActivity look like: public class MainActivity extends AppCompatActivity implements Callbacks { ArrayList<CallLogItem> mItems = new ArrayList<>(); private RecyclerView mRecyclerView; private RecyclerView

How to create a link to contact specific phone number via Telegram?

邮差的信 提交于 2020-01-03 15:34:25
问题 So I found out I could use a link like this in HTML: <a href="https://api.whatsapp.com/send?phone={{phone_number}}" target="_blank">WhatsApp</a> in order to let a user contact {{phone_number}} directly from a webpage (via WhatsApp web). My question is: how to do the same but instead of WhatsApp, via Telegram? Thank you in advance 回答1: It's NOT possible to link to Telegram like this for a phone numbers so far, because every user MUST add the phone number to their contact list before they can

Read Contacts without Permission?

蓝咒 提交于 2020-01-03 07:21:19
问题 I want to read Contacts via Contacts Picker like this: Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(contact, CONTACT_PICK_CODE); If I get the Result, the intent.getData() contains an uri to lookup the Contact, but I need the permission READ_CONTACTS to to read it. I thought it may be possible to recieve a Contact without this permission, similar to the CALL permission: If I want to make a call directly, I need it, but without it I

Get the contacts list from phone and display it using RecyclerView and implement SearchView functionality to search

泪湿孤枕 提交于 2020-01-03 06:46:09
问题 In this I am able to get the details of my contacts. But not using RecyclerView. It is using ListView. It is using SimpleCursorAdapter. I don't know how to use SimpleCursorAdapter in RecyclerView. I know how to use RecyclerView with constants String to display. But in this I want to retrieve data using Contacts DB. Please Help me I am new to android. I don't know how to implement this. Thanks in advance public class MainActivity extends AppCompatActivity { SimpleCursorAdapter mAdapter;