I have some code that creates some notifications, it\'s really basic.
int icon = R.drawable.notification;
CharSequence tickerText = \"Text\";
long when = Sys
You can't swipe away your notification, because it is in an "ONGOING"-State.
First the solution:
Replace setting flags with following code:
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_VIBRATE;
notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Defaults are for the defaults-section, flags for the flags-section.
And now the reason why it was ongoing?
As you might already know flags (and defaults) for notifications are set by a bitwise operation. Means each flag has a constant value which is a power of 2. Adding them results in an unique number for a set of flags which makes it real fast to calculate which flags are actually set.
Notification.DEFAULT_VIBRATE and Notification.FLAG_ONGOING_EVENT have the same contant value of 2.