Questions tagged [android-notification-bar]

Use this tag for questions relating to issues showing your notification in the notification area.

When you tell the system to issue a notification, it first appears as an icon in the notification area. To see the details of the notification, the user opens the notification drawer. Both the notification area and the notification drawer are system-controlled areas that the user can view at any time.

Useful links

359 questions
149
votes
7 answers

Notification passes old Intent Extras

i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon =…
103
votes
6 answers

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

Android 4.1 offers the user a check box to disable notifications for a specific application. However, as a developer we have no way to know whether a call to notify was effective or not. I really need to check if the notifications are disabled for…
73
votes
9 answers

Load image from url in notification Android

In my android application, i want to set Notification icons dynamically which will be loaded from URL. For that, i have used setLargeIcon property of NotificationBuilder in receiver.I reffered many link and tried various solutions but couldn't get…
67
votes
8 answers

Why do icons set with Notification.Builder.setSmallIcon in Android Lollipop show as a white square?

I have this code: Notification notif; // Build notification Notification.Builder notifBuilder = new…
61
votes
9 answers

How to create a notification with NotificationCompat.Builder?

I need to create a simple notification which will be shown in notification bar along with the sound and icon if possible? I also need it to be compatitible with Android 2.2, so i found that NotificationCompat.Builder works with all APIs above 4. If…
42
votes
3 answers

How to set the app icon as the notification icon in the notification drawer

As shown in the figure... I am getting my notification icon(on left to the red colour). But I need to display the app icon as shown by the black arrow public void notify(View view){ notification.setSmallIcon(R.drawable.ic_stat_name); …
39
votes
5 answers

Listen to incoming Whatsapp messages/notifications

I'm working on a notification based app, for which I need to listen to incoming notifications. I've been able to listen to incoming calls, SMS, mail etc. I have no clue how to listen for pings or messages from friends on Whatsapp via code. Can this…
34
votes
7 answers

How can I programmatically open/close notifications in Android?

I've searched everywhere, but can't find anything in the SDK or on Google on how to do this. I know it's possible because all the custom launchers are able to do it via a button press (LauncherPro, ADW, etc). Thanks.
user496854
  • 6,461
  • 10
  • 47
  • 84
25
votes
4 answers

Android: How can I put my notification on top of notification area?

I'm trying to put my notification on top of notification area. A solution is to set the parameter "when" to my notification object with a future time like: notification.when = System.currentTimeMills()*2; The code that I'm using in this: long…
22
votes
3 answers

putExtra using pending intent not working

I have written a code in my GCMIntentservice that sends push notifications to many users. I use the NotificationManager that will call DescriptionActivity class when the notification is clicked. I also send the event_id form the GCMIntentService to…
21
votes
5 answers

Allow notification to be cancelled after calling stopForeground(false)

I have a Media service that uses startForeground() to show a notification when playback starts. It has pause/stop buttons when playing, play/stop buttons while paused. NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); //…
21
votes
4 answers

non removable notification

In my app, there is service running on background. I want to notify user that the service is running. But I need that user cannot delete the notification - by pressing clear button or by swipe it out, in notification bar It means I need to show my…
Kelib
  • 648
  • 2
  • 7
  • 15
20
votes
4 answers

Set Drawable or Bitmap as icon In Notification in Android

I download a image from server as bitmap and convert it to drawable now i want to use this drawable as notification icon. But i am unable to do that. here is my code: Notification notification = new NotificationCompat.Builder(context) …
User42590
  • 2,473
  • 12
  • 44
  • 85
19
votes
3 answers

Remove notification from notification bar from other applications

I want to remove notifications from another application shown in the notification bar. Is that possible? NotificationManager.cancelAll(); cancels only notifications shown by the calling application, as far as I know. Why do I want to do this? I have…
johboh
  • 1,003
  • 2
  • 9
  • 10
17
votes
6 answers

Disable the notification panel from being pulled down

I am working on a lockscreen app and I need to disable the ability to pull down the notification/status bar at the top of the screen. There is an app called Holo Locker and what this app does is when the user pulls down from the top of the screen,…
DDukesterman
  • 1,391
  • 5
  • 24
  • 42
1
2 3
23 24