android - Getting details of edited contact back using ACTION_EDIT and startActivityForResult() -
i maintaining list of contacts application. first pick contact using action_pick intent. saving these contacts in local database along contact_id. user may choose edit contact add information app needs. fire edit intent action_edit. have 2 questions here
i saving
contact_iddatabase in order use in edit intent. first question id changes after edition ? because happens unable open contact editor same contact again.second question how can read details of edited contact ? getting in
onactivityresult(). have tried use same code using in case of picking data structure returned in case of edit different seems.
you can data contacts using cursor like
string[] projection = new string[] { contactscontract.phonelookup.display_name, contactscontract.phonelookup._id}; // query time cursor cursor = _context.getcontentresolver() .query("contactscontract.contacts.content_uri", projection, null, null, null); if(cursor != null) { while ( cursor.movetonext()) { string name = cursor.getstring(cursor.getcolumnindex( contactscontract.phonelookup.display_name)); // other stuff } } cursor.close(); take @ https://developer.android.com/training/contacts-provider/retrieve-details.html
Comments
Post a Comment