[Solved] How to get more than one contacts in editTexts [closed]

startActivityForResult AND onActivityResult have [int requestCode] in paramters. Use requestCode to determine which editText is handling and fill text for it Call another activity: startActivityForResult(newActivity, requestCode); When result is returned: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub switch (requestCode) { case 1://working with first edit text //fill … Read more

[Solved] Getting Name,Phone Number and Email Address From Phone Contacts [closed]

I do it this way for Android 2.2 Froyo release: basically use eclipse to create a class like: public class SomePickContactName extends Activity then insert this code. Remember to add the private class variables and CONSTANTS referenced in my version of the code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intentContact = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); … Read more

[Solved] How to get contact id after add a new contact in android?

Try this code, ContentProviderResult[] res = getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops); Uri myContactUri = res[0].uri; int lastSlash = myContactUri.toString().lastIndexOf(“https://stackoverflow.com/”); int length = myContactUri.toString().length(); int contactID = Integer.parseInt((String) myContactUri.toString().subSequence(lastSlash+1, length)); I hope this code help you.. 0 solved How to get contact id after add a new contact in android?