How to mask missed calls to read in Android?

后端 未结 1 433
我在风中等你
我在风中等你 2021-01-28 09:07

I am working to an Android app that displays the missed calls using:

String[] projection = new String[]{
    CallLog.Calls.NUMBER,
    CallLog.Calls.TYPE,
    Ca         


        
相关标签:
1条回答
  • 2021-01-28 09:51

    By setting is_read flag to true. Reference: http://developer.android.com/reference/android/provider/CallLog.Calls.html#IS_READ

    Example (from ClearMissedCallsService):

        // Clear the list of new missed calls.
        ContentValues values = new ContentValues();
        values.put(Calls.NEW, 0);
        values.put(Calls.IS_READ, 1);
        StringBuilder where = new StringBuilder();
        where.append(Calls.NEW);
        where.append(" = 1 AND ");
        where.append(Calls.TYPE);
        where.append(" = ?");
        context.getContentResolver().update(Calls.CONTENT_URI, values, where.toString(),
                new String[]{ Integer.toString(Calls.MISSED_TYPE) });
    
    0 讨论(0)
提交回复
热议问题