我在此处描述的 android 代码中遇到了一个错误:
http://code.google.com/p/android/issues/detail?id=9840
但是,我对他们所说的话感到非常困惑,例如:
我还错误地发送了一个NULL通知,并导致系统进程崩溃。我的代码是:
int icon = R.drawable.notification_icon; CharSequence tickerText = "Filter Active"; long when = System.currentTimeMillis(); Notification n = new Notification(icon, tickerText, when); startForeground(startId, n);
从服务。
我不明白为什么他说当 n 明显被实例化并传递给 startForeground 服务方法时他正在发送一个空通知。这几乎就是我的代码的样子,我找不到任何解释为什么它是错误的或什么是正确的方法。