修改联系人编辑界面未弹出问题。

This commit is contained in:
ZhanGSKen
2025-10-18 13:40:15 +08:00
parent 72cbe4f066
commit 98874bedc9
4 changed files with 13 additions and 16 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sat Oct 18 05:13:11 GMT 2025
#Sat Oct 18 05:39:08 GMT 2025
stageCount=19
libraryProject=
baseVersion=15.3
publishVersion=15.3.18
buildCount=3
buildCount=15
baseBetaVersion=15.3.19

View File

@@ -73,6 +73,7 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactV
} else if (nItemId == R.id.item_calllog_phonenumber_edit_contact) {
//ToastUtils.show("Test");
Long nContactId = ContactUtils.getContactIdByPhone(mContext, contact.getNumber());
//ToastUtils.show(String.format("%d", nContactId));
ContactUtils.jumpToEditContact(mContext, contact.getNumber(), nContactId);
}

View File

@@ -95,7 +95,7 @@ public class ContactsFragment extends Fragment {
recyclerView = (RecyclerView) view.findViewById(R.id.contacts_recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
contactList = new ArrayList<ContactModel>();
contactAdapter = new ContactAdapter(getContext(), contactList);
contactAdapter = new ContactAdapter(getActivity(), contactList);
recyclerView.setAdapter(contactAdapter);
// 初始隐藏列表,数据加载后显示
recyclerView.setVisibility(View.GONE);

View File

@@ -13,6 +13,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.utils.ToastUtils;
import java.util.HashMap;
import java.util.Map;
@@ -153,9 +154,8 @@ public class ContactUtils {
// 构建联系人的Uri格式content://contacts/people/[contactId],系统标准格式)
Uri contactUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, contactId);
intent.setData(contactUri);
}
// 场景B未知ID通过电话号码匹配需系统支持号码匹配小米机型兼容
else if (phoneNumber != null && !phoneNumber.isEmpty()) {
//ToastUtils.show("1");
} else if (phoneNumber != null && !phoneNumber.isEmpty()) {
// 方式1小米等机型兼容的“通过号码定位联系人”参数部分系统认此参数
//intent.putExtra(ContactsContract.Intents.Insert.PHONE_NUMBER, phoneNumber);
// 方式2补充系统标准的“数据Uri”强化匹配避免参数被定制系统忽略
@@ -173,13 +173,9 @@ public class ContactUtils {
}
// 启动活动(加防护,避免无联系人应用崩溃)
if (intent.resolveActivity(context.getPackageManager()) != null) {
// 小米机型在Service/非Activity中调用需加NEW_TASK标志否则可能无法启动
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} else {
LogUtils.d(TAG, "编辑联系人失败:设备未安装联系人应用");
}
}
/**