此代码经测试后不会抛出参数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. [信息图表]iPhone和Android的系统生命周
  2. android mvp模式讲解
  3. Android的AndroidManifest.xml android:p
  4. android 图片处理 resize 探秘(图片缩放、
  5. 方便的Android無線管理軟體---remote web
  6. android MVC结构探讨
  7. Android学习札记49:在Android中使用Applic
  8. android 使用 pull 解析xml文件
  9. Android的ImageButton问题
  10. 面对Android的衰落,路在何方?