如何知道未接来电是否由用户阅读?

时间:2013-10-29 09:14:22

标签: android android-contentprovider

我想知道用户是否读取了未接来电。我是用户阅读然后我必须更新内容提供商。我怎么能这样做?

2 个答案:

答案 0 :(得分:1)

答案 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;