Fatal Exception: java.lang.RuntimeException: bad array lengths
at android.os.Parcel.readIntArray(Parcel.java:926)
at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:777)
at android.app.NotificationManager.notify(NotificationManager.java:272)
at android.app.NotificationManager.notify(NotificationManager.java:211)
at cc.netpas.android_firewall.service.BackgroundDaemon$3.run(BackgroundDaemon.java:297)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
设置通知栏时会发生以上错误,有哪位大神指点指点
这是代码:
private Runnable updateConnectedTimer = new Runnable() {
@Override
public void run() {
if (BackgroundDaemon.this.connectedTime == 0) {
BackgroundDaemon.this.connectedTime = System.currentTimeMillis();
}
long resultTime = System.currentTimeMillis() - connectedTime;
Notification notification = showNotification(BackgroundDaemon.this, "", Utils.getElapsedTimeInFormat(resultTime));
notificationManager.notify(0x100, notification);
// }
if (handler != null) {
handler.postDelayed(this, 1000);
}
}
};