【问题标题】:How to access Call Log in Android Watch?如何在 Android Watch 中访问通话记录?
【发布时间】:2016-01-01 02:29:46
【问题描述】:

我在 android 应用程序中使用此代码来接听未接电话。

cursor = this.getContentResolver().query(
    Uri.parse("content://call_log/calls"),
    projection,
    selection,
    selectionArgs,
    sortOrder
);

while (cursor.moveToNext()) {
    String callType = cursor.getString(
                cursor.getColumnIndex(android.provider.CallLog.Calls.TYPE));

    String isCallNew = cursor.getString(
                cursor.getColumnIndex(android.provider.CallLog.Calls.NEW));

    if (Integer.parseInt(callType) == CallLog.Calls.MISSED_TYPE
            && Integer.parseInt(isCallNew) > 0) {
        missedCallCount++;
}

但是当我在 android watch 应用程序中使用此代码时它不起作用。有人知道如何在 android watch 中访问 CALL_LOG 吗?

我认为解决这个问题的方法之一是在手机和手表中构建一个应用程序,然后手机的应用程序访问 CALL_LOG 并使用蓝牙将其发送到手表的应用程序。但我只想在手表幻灯片中构建应用程序来解决这个问题。

【问题讨论】:

  • 对不起,我在 "missedCallCount++;" 之后错过了一个右括号
  • 我需要同样的,可行,我在 Play 商店中看到一个应用,删除 Android Wear 中的通话记录

标签: android wear-os calllog


【解决方案1】:

手表上无法直接获取该信息,您需要通过手机获取。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-21
    • 1970-01-01
    • 2011-12-11
    • 1970-01-01
    • 1970-01-01
    • 2011-06-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多