@Override    public void onWindowFocusChanged(boolean hasFocus) {        super.onWindowFocusChanged(hasFocus);        // Clear notifications only when window gains focus.  This activity won't        // immediately receive focus if the keyguard screen is above it.        if (hasFocus) {            try {                ITelephony iTelephony =                        ITelephony.Stub.asInterface(ServiceManager.getService("phone"));                if (iTelephony != null) {                    iTelephony.cancelMissedCallsNotification();//删除未接来电通知                } else {                    Log.w(TAG, "Telephony service is null, can't call " +                            "cancelMissedCallsNotification");                }            } catch (RemoteException e) {                Log.e(TAG, "Failed to clear missed calls notification due to remote exception");            }        }    }    private void resetNewCallsFlag() {//修改数据库字段,使改条通话记录不是最新通知  防止机器重新启动后又有未接电话通知        // Mark all "new" missed calls as not new anymore        StringBuilder where = new StringBuilder("type=");        where.append(Calls.MISSED_TYPE);        where.append(" AND new=1");        ContentValues values = new ContentValues(1);        values.put(Calls.NEW, "0");        this.getContentResolver().update(Calls.CONTENT_URI, values, where.toString(), null);    }

更多相关文章

  1. Android 发送通知
  2. 【notification】Android 中创建震动通知
  3. Android 技巧 - notification center 发出通知时显示文字
  4. Android消息通知-Notification
  5. [导入]2010-03-06 传智播客—Android(六)通知、样式、主题、HTML
  6. 去除Android系统应用的通知功能
  7. 收藏-------------Android应用程序组件Content Provider的共享数

随机推荐

  1. Android自动化测试之如何安装Android虚拟
  2. Android(安卓)4.0新增WiFiDirect功能
  3. Android实例剖析笔记(二)
  4. Android与JS互调的简单使用
  5. Android(安卓)Studio签名打包应用
  6. android开发视频教程 android培训入门教
  7. 我的Android音乐播放器
  8. Android(安卓)关机解析
  9. Android(安卓)修改EditText光标颜色
  10. 关于android中的gif实现