Android - Check the phone number type -
i'd update contacts in phone according logic. when write them database, have determine type under stored using illustration mobile contact.
contactscontract.commondatakinds.phone.type_mobile
// number mobile builder = contentprovideroperation.newupdate(contactscontract.data.content_uri); builder.withselection(contactscontract.data.contact_id + "=?" + " , " + contactscontract.data.mimetype + "=?"+ " , " + contactscontract.commondatakinds.organization.type + "=?", new string[]{string.valueof(id), contactscontract.commondatakinds.phone.content_item_type, string.valueof(contactscontract.commondatakinds.phone.type_mobile)}); builder.withvalue(contactscontract.commondatakinds.phone.number, number); ops.add(builder.build());
i want set in switch case able check appropriate type either: type_work
type_home
type_company_main
type_assistant
type_isdn
but i'm little clueless on key use. can help?
use int type:
int number_type; // type of phone no. update switch(number_type) { case contactscontract.commondatakinds.phone.type_work: // code update.. break; case contactscontract.commondatakinds.phone.type_mobile: // , on.... break; }
android
No comments:
Post a Comment