想要启动特定人员的通话记录和联系人吗?

发布于 2025-01-08 06:02:59 字数 144 浏览 1 评论 0原文

我有联系人的电话号码和姓名。有了这些信息,我如何启动联系人:

  1. 通话记录详细信息活动
  2. 编辑联系人活动

我可以仅启动通话记录和联系人的启动活动。相反,我想直接导航到一个人的记录。知道如何实现这一目标吗?

I have a contact's phone number and name. With this information, how can I launch the contact:

  1. call history details activity
  2. edit contacts activity

I'm able to launch just the starting activity of call history and contacts. Instead I want to directly navigate into a person's record. Any idea how to achieve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜访吸血鬼 2025-01-15 06:02:59

这对我来说效果很好。请看一下。

   contactNumber = Uri.encode(contactNumber);

   int phoneCallLogID = new Random().nextInt();
   Cursor callLogLookupCursor = context.getContentResolver().query(Uri.withAppendedPath(android.provider.CallLog.Calls.CONTENT_FILTER_URI,contactNumber),null, null, null, null);
       while(callLogLookupCursor.moveToNext()){
           phoneCallLogID = callLogLookupCursor.getInt(callLogLookupCursor.getColumnIndexOrThrow(CallLog.Calls._ID));

           }
       callLogLookupCursor.close();
        Uri uri = Uri.withAppendedPath(
                android.provider.CallLog.Calls.CONTENT_URI, String.valueOf(phoneCallLogID));



   Intent intent = new Intent(Intent.ACTION_VIEW);
   intent.setData(uri);
   startActivityForResult(intent,0);

This is working fine for me. Please take a look.

   contactNumber = Uri.encode(contactNumber);

   int phoneCallLogID = new Random().nextInt();
   Cursor callLogLookupCursor = context.getContentResolver().query(Uri.withAppendedPath(android.provider.CallLog.Calls.CONTENT_FILTER_URI,contactNumber),null, null, null, null);
       while(callLogLookupCursor.moveToNext()){
           phoneCallLogID = callLogLookupCursor.getInt(callLogLookupCursor.getColumnIndexOrThrow(CallLog.Calls._ID));

           }
       callLogLookupCursor.close();
        Uri uri = Uri.withAppendedPath(
                android.provider.CallLog.Calls.CONTENT_URI, String.valueOf(phoneCallLogID));



   Intent intent = new Intent(Intent.ACTION_VIEW);
   intent.setData(uri);
   startActivityForResult(intent,0);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文