此代码经测试后不会抛出参数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仿人人客户端(v5.7.1)——消息中心
  2. Android 架构组件之一
  3. 当视频网站都支持html5
  4. Unity NGUI UI 在iOS端的锯齿、模糊、颗
  5. Android MVP架构
  6. 三星 Galaxy Nexus 及 Android 4.0 Ice C
  7. android的类AsyncTask
  8. 又一部承诺会升上 Ice Cream Sandwich 的
  9. ZDC:2011年Android手机用户使用行为研究报
  10. Android中调用手机自带输入法比如三星s58