此代码经测试后不会抛出参数IllegalArgumentException异常

private void notification() {try {mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);Intent intent = new Intent(this, TaskManager.class);CharSequence appName = getString(R.string.app_name);Notification notification = new Notification(R.drawable.icon,appName, System.currentTimeMillis());notification.flags = Notification.FLAG_NO_CLEAR;CharSequence appDescription = getString(R.string.app_name) + " "+ getString(R.string.is_running);notification.setLatestEventInfo(Splash.this, appName,appDescription, PendingIntent.getActivity(getBaseContext(),0, intent, PendingIntent.FLAG_CANCEL_CURRENT));mNotificationManager.notify(0, notification);} catch (Exception e) {mNotificationManager = null;Log.e("Splash", "Splash", e);}}

更多相关文章

  1. mybatisplus的坑 insert标签insert into select无参数问题的解决
  2. Python技巧匿名函数、回调函数和高阶函数
  3. python list.sort()根据多个关键字排序的方法实现
  4. android EditText设置不可写
  5. android 使用html5作布局文件: webview跟javascript交互
  6. android studio调试c/c++代码
  7. IM-A820L限制GSM,WCDMA上网的原理(其他泛泰机型可参考)7.13
  8. 锁屏界面
  9. android(NDK+JNI)---Eclipse+CDT+gdb调试android ndk程序

随机推荐

  1. Android绘制(三):Path结合属性动画, 让图
  2. Android(安卓)滑动切换(首页展示,图片、新
  3. Android(安卓)UI控件学习(一)——拖动条
  4. [原] Android监听网络的变化
  5. 如何在Android中整合立体声音效处理库|Op
  6. Android客户端移动流量无法登陆OpenFire
  7. Android之反编译技术
  8. android中动态输入日期与时间
  9. android类型的毕业设计大作业的源码,去哪
  10. 【凯子哥带你学Android】Andriod性能优化