標籤:android for 檔案 問題 cti sp on c new
1.手機插入普通SIM卡
2.登入郵箱並添加郵箱地址到SIM卡中;
3.探索信箱地址沒有添加進入,只添加進了姓名或電話號碼
這是Google Default行為,在儲存時,會進行安全檢查,發現有不合法的欄位時會自動過濾掉該欄位。
對於Sim卡,不支援Email欄位,所以會過濾掉該欄位。
如果不想要這樣的行為,想修改為當發現儲存的內容中有Email欄位,就不顯示出SIM帳號,可按如下方式修改。
一共需要修改3個檔案:
1. com.android.contacts.editor.ContactEditorFragment
找到Intent intent = new Intent(mContext, ContactEditorAccountsChangedActivity.class);
在其下面添加一行:intent.putExtra("data", mIntentExtras);
2.com.android.contacts.activities.ContactEditorAccountsChangedActivity
找到mAccountListAdapter = new AccountsListAdapter(this, AccountListFilter.ACCOUNTS_CONTACT_WRITABLE);
在其下面添加一行:mAccountListAdapter.filterAccountWithBundle(getIntent().getBundleExtra("data"));
3.com.android.contacts.util.AccountsListAdapter
在該檔案中添加這個方法:
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);
}
}
}
}
android 儲存手機郵件中的郵箱地址到連絡人,郵箱地址丟失的問題