Android saves the email address in the mobile phone email to the contact. The email address is lost.

Source: Internet
Author: User

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 );
}
}
}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.