我目前正在使用以下方法检测未接来电:
String[] projection = new String[]{CallLog.Calls.NUMBER,
CallLog.Calls.TYPE,
CallLog.Calls.DURATION,
CallLog.Calls.CACHED_NAME,
CallLog.Calls._ID};
String where = CallLog.Calls.TYPE+"="+CallLog.Calls.MISSED_TYPE+" AND NEW = 1";
Cursor c = context.getContentResolver().query(CallLog.Calls.CONTENT_URI,projection,where, null, null); c.moveToFirst();
Log.d("CALL", ""+c.getCount());
if(c.getCount() > 0)
// code that displays in a textview the number of missed calls;
使用标志我正在向客户显示未接来电。
如果读取未接来电,有没有办法可以将 textview 值重置为 0?
当读取未接电话时,是否有广播接收器或通知我的东西?