此代码经测试后不会抛出参数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); } }
?
?
?