我想知道用户是否读取了未接来电。我是用户阅读然后我必须更新内容提供商。我怎么能这样做?
答案 0 :(得分:1)
检查此链接我认为这会对您有所帮助:
How to get Missed call & SMS count
how to mask missed calls to read in android?
http://developer.android.com/reference/android/provider/CallLog.Calls.html
答案 1 :(得分:0)
试试这个:
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 the number of missed calls;