Android saves the email address in the mobile phone email to the contact. The email address is lost.
1. Insert a common SIM card into your mobile phone
2. log on to the mailbox and add the email address to the SIM card;
3. the email address is not added. Only the name or phone number is added.
This is the Google Default action. When saved, the security check is performed. When an invalid field is found, the field is automatically filtered out.
The Email field is not supported for SIM cards, so this field is filtered out.
If you do not want this behavior, you can modify it as follows to prevent the SIM account from being displayed when an Email field is found in the saved content.
A total of three files need to be modified:
1. com. android. contacts. editor. ContactEditorFragment
Find Intent intent = new Intent (mContext, contactedit1_countschangedactivity. class );
Add a line below: intent. putExtra ("data", mIntentExtras );
2.com. android. contacts. activities. contactedit1_countschangedactivity
Find mAccountListAdapter = new AccountsListAdapter (this, AccountListFilter. ACCOUNTS_CONTACT_WRITABLE );
Add a line below: mAccountListAdapter. filterAccountWithBundle (getIntent (). getBundleExtra ("data "));
3.com. android. contacts. util. AccountsListAdapter
Add this method to the file:
Public void filterAccountWithBundle (Bundle bundle ){
If (bundle = null ){
Return;
}
String email = bundle. getString ("email ");
If (! TextUtils. isEmpty (email )){
Int count = getCount ();
For (int I = count-1; I> = 0; I --){
If (mAccounts. get (I). type. equals ("SIM Account ")){
MAccounts. remove (I );
}
}
}
}