Notification passes old Intent Extras

You are sending the same request code for your pending intens. Change this: PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); To: PendingIntent contentIntent = PendingIntent.getActivity(context, UNIQUE_INT_PER_CALL, notificationIntent, 0); intents are not created if you send the same params. They are reused.

Disable the notification panel from being pulled down

This is possible using reflection. There are plenty of problems though. There’s no way to check if the notification panel is open, or opening. So, we’ll have to rely on Activity#onWindowFocusChanged(boolean). And this is where the problems begin. What the method does: public void onWindowFocusChanged (boolean hasFocus) Called when the current Window of the activity … Read more

How to create a notification with NotificationCompat.Builder?

The NotificationCompat.Builder is the most easy way to create Notifications on all Android versions. You can even use features that are available with Android 4.1. If your app runs on devices with Android >=4.1 the new features will be used, if run on Android <4.1 the notification will be an simple old notification. To create … Read more

Android 4.1: How to check notifications are disabled for the application?

You can’t 100% can’t. It is asked in this Google I/O 2012 video and the Project lead for the new notifications declares that you can’t. Edit 2016 update: Now you can check it, as said in this Google I/O 2016 video. Use NotificationManagerCompat.areNotificationsEnabled(), from support library, to check if notifications are blocked on API 19+. … Read more

tech