Android Emulator Crashes Claiming “Null Notification?

Up vote 1 down vote favorite share g+ share fb share tw.

I'm running into a bug in the android code described here: code.google.com/p/android/issues/detail?... However I'm extremely confused by what they are saying for example: I also sent a NULL notification by mistake, and crashed the system process. My code was: int icon = R.drawable. Notification_icon; CharSequence tickerText = "Filter Active"; long when = System.

CurrentTimeMillis(); Notification n = new Notification(icon, tickerText, when); startForeground(startId, n); from a service. I don't understand why he's saying that he's sending a null notification when n is clearly being instantiated and passed to the startForeground service method. This is almost exactly what my code looks like and I can't find any explanation as to why it's wrong or what is the proper way.

Android android-notifications link|improve this question edited Dec 5 '11 at 18:31 asked Dec 5 '11 at 18:21Spencer Ruport16.7k13062 94% accept rate.

Found it. I agree with the sentiments expressed here. Completely unacceptable on all counts.

Lack of documentation, ridiculous default behavior and a blatent design flaw which crashes the entire OS. code.google.com/p/android/issues/detail?... Essentially the setLatestEventInfo method must be called for the notification to be valid.

1 I find the documentation satisfactory if not wonderful. Also, it doesn't make a whole lot of sense to have a notification without a title/text. I do agree though that you shouldn't be able to crash a system service like that.

I would guess it's just been a lower priority bug because it's fairly hard to do without noticing so I doubt it's made it into too many released apps. – kabuko Dec 5 '11 at 18:56 Oh, also I think they recognized that the API isn't so wonderful and so added a Builder to clean it up. Only API 11 though unfortunately.

– kabuko Dec 5 '11 at 20:03 I don't think many people look at document examples and expect the entire piece of code to be written exactly that way otherwise horrible things will happen. Especially if the piece of code they leave out seems to be optional and especially if no graceful Runtime Error is presented for doing so. – Spencer Ruport Dec 6 '11 at 8:22.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions