如何在Android Watch中访问呼叫日志?
我在android应用程序中使用此代码来获取未接来电如何在Android Watch中访问呼叫日志?,android,wear-os,calllog,Android,Wear Os,Calllog,我在android应用程序中使用此代码来获取未接来电 cursor = this.getContentResolver().query( Uri.parse("content://call_log/calls"), projection, selection, selectionArgs, sortOrder ); while (cursor.moveToNext()) { String callType = cursor.getString(
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_日志吗
我认为解决这个问题的方法之一是在phone&watch中构建一个应用程序,然后手机的应用程序访问CALL_LOG并使用蓝牙将其发送到watch的应用程序。但我只想在手表幻灯片中构建应用程序来解决这个问题。手表上没有直接提供的信息,您需要从手机中获取。抱歉,我在“missedCallCount++”之后错过了一个紧括号;“我需要相同的,是可能的,我在play store中看到一个应用程序,在Android wear中删除通话日志。”