所以我想获得未接来电的计数,例如通知栏中显示的电话应用程序
所以我想出了这段代码:
String[] projection = { CallLog.Calls.CACHED_NAME, CallLog.Calls.CACHED_NUMBER_LABEL, CallLog.Calls.TYPE };
String where = CallLog.Calls.TYPE+"="+CallLog.Calls.MISSED_TYPE;
Cursor c = this.getContentResolver().query(CallLog.Calls.CONTENT_URI,projection,where, null, null);
c.moveToFirst();
Log.d("CALL", ""+c.getCount()); //do some other operation
if(c.getCount() > 0)//...etc etc
Toast.makeText(app.this,String.valueOf(c.getCount()), Toast.LENGTH_LONG).show();
这段代码给了我未接来电的总数,但我只想要通知栏中显示的最新来电
有人知道怎么做吗?