You may pass the parameter PendingIntent. GetActivity(getApplicationContext(), 0, new Intent(), 0) instead of null on notification. SetLatestEventInfo(context, contentTitle, contentText, null).
Works! Awesome. +1 – Matt K Aug 12 at 14:03 I was calling from a broadcastreceiver and found that it was coming up with a null exception.
However I tried this class I found (some guy was making a notification class) and its brilliant - check it out stackoverflow. Com/questions/5626946/… – Garbit Aug 15 at 11:51.
The last parameter in setLatestEventInfo() is a PendingIntent and not an Intent. If you need the notification to not do anything when tapped is to pass an empty PendingIntent which is done as follows: PendingIntent. GetActivity(context, 0, null, 0).
Bot this and the accepeted answer work just fine but this one is more simple, no need to create an empty Intent when you can just pass null. – Ricardo Amaral Sep 28 at 20:50.
Interesting question and I would like to see if this works. I did a little digging and found a lot of ppl asking the same question. Cbursk seems to have found a hack to get this intended functionality, which is to pass a Dialog to the notification intent instead of an Activity.
I'm guessing the Dialog does nothing, or is programmed to dismiss itself right away, not sure. But I'm currently looking at this thread and going to test it out.
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.