【发布时间】: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 中的通话记录