1.未接电话的产生 /* * 未接来电不能用* Observer监听,不过当有新的未接来电时,系统会发送一个广播com.android * .phone.NotificationMgr.MissedCall_intent( * 锁屏上显示的未接来电数量就是通知监听这个广播实现的) */ 因此基于广播----->/* final IntentFilter filter = new IntentFilter(); filter.addAction("com.android.phone.NotificationMgr.MissedCall_intent"); final Application application = getApplication(); application.registerReceiver( new BroadcastReceiver() { @Override public void onReceive(Context context,Intent intent) { String action = intent.getAction(); if (action != null&& "com.android.phone.NotificationMgr.MissedCall_intent".equals(action)) { int mMissCallCount = intent.getExtras().getInt("MissedCallNumber"); Toast.makeText(CallPhoneActivity.this, mMissCallCount+"",Toast.LENGTH_SHORT).show(); } } }, filter);*/--------------但是只能说亲测无效,未接受 ..... 2.读取未接电话的个数 private int readMissCall() { result = 0; // Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, // new String[] { Calls.TYPE }, " type=? and new=?", // new String[] { Calls.MISSED_TYPE + "", "1" }, "date desc"); Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, new String[] { Calls.TYPE }, " type=?", new String[] { Calls.MISSED_TYPE + ""}, "date desc"); if (cursor != null) { result = cursor.getCount(); cursor.close(); } return result; } 注意被注释掉的cursor的区别,限定了Call.New(android.provider.CallLog.Calls.NEW),会使得你过短时间,未接电话的读取个数清空,没有仔细研究过这个变量的具体定义,也懒得理解了..注意Call.New>0 若是想深入的了解,可以访问http://www.apihome.cn/api/android/CallLog.Calls.html. 3.未接电话相关信息的读取-----一些参数还得参照http://www.apihome.cn/api/android/CallLog.Calls.html contactlist.clear(); final String[] projection = null; final String selection = null; final String[] selectionArgs = null; final String sortOrder = android.provider.CallLog.Calls.DATE + " DESC"; Cursor cursor = null; try { cursor = getContentResolver().query( Uri.parse("content://call_log/calls"), projection, selection, selectionArgs, sortOrder); while (cursor.moveToNext()) { callName= cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.CACHED_NAME)); String callLogID = cursor.getString(cursor .getColumnIndex(android.provider.CallLog.Calls._ID)); callNumber = cursor.getString(cursor .getColumnIndex(android.provider.CallLog.Calls.NUMBER)); //需要对时间进行一定的处理 callDate = cursor.getString(cursor .getColumnIndex(android.provider.CallLog.Calls.DATE)); long callTime = Long.parseLong(callDate); SimpleDateFormat sdf = new SimpleDateFormat( "M-dd HH:mm"); callDate = sdf.format(new Date(callTime)); callType = cursor.getString(cursor .getColumnIndex(android.provider.CallLog.Calls.TYPE)); String isCallNew = cursor.getString(cursor .getColumnIndex(android.provider.CallLog.Calls.NEW)); // if (Integer.parseInt(callType) == (CallLog.Calls.MISSED_TYPE) // && Integer.parseInt(isCallNew) > 0) //通过call.new进行了限定,会对读取有一些问题,要删掉该限定 if (Integer.parseInt(callType) == (CallLog.Calls.MISSED_TYPE)) { //textView.setText(callType+"|"+callDate+"|"+callNumber+"|"); //只是以最简单ListView显示联系人的一些数据----适配器的如何配置可查看http://blog.csdn.net/cl18652469346/article/details/52237637 contactlist.add(callName+"----"+callDate+"----"+callNumber+"----"+"callType:"+callType); } } } catch (Exception e) { e.printStackTrace(); } finally { cursor.close(); }. } 未接电话的属性很多,可以自行查看已给出的链接,当然少不了数据格式的转换,比如Call.DATE(转换如上) .