Questions tagged [android-notifications]

A status notification adds an icon to the system's status bar (with an optional ticker-text message) and a notification message in the notifications window.

A notification is a user interface element that you display outside your app's normal UI to indicate that an event has occurred. Users can choose to view the notification while using other apps and respond to it when it's convenient for them.

Think of notifications as a news channel that alerts the user to important events as they happen or a log that chronicles events while the user is not paying attention. The user can expand the notification bar and by selecting the notification the user can trigger another activity. Notifications in Android are represented by the Notification class. To create notifications you use the NotificationManager class which can be received from the Activity via the getSystemService() method.

Useful links

4920 questions
2
votes
1 answer

Android notification small icon background is always black

I created notification for android with NotificationBuilder, eventhough i set .setColor(), it ignores the color and sets small icon's background color black. My target SDK is 23 and min SDK is 19. And the phone that i am using for debug has Android…
2
votes
1 answer

android - white circle notification icon in android 5

I've a problem with the notification icon in android . this is my code : Notification myNotification = new NotificationCompat.Builder(ctx) .setSmallIcon(getNotificationIcon()) …
2
votes
5 answers

Firebase Cloud Messaging, issues in receiving notification

I'm trying to write an application to receive notifications via Firebase Cloud Messaging. It initially worked when I tried to send the message via Firebase console but then the moment I tried doing the same using php webservice, in response, it…
2
votes
1 answer

How to show image on the right hand side of the notification in android

I am working on android application . I need to create a notification for the app. I am able to create it successfully using : http://www.tutorialspoint.com/android/android_notifications.htm I know NotificationCompat.Builder setNumber(int Number) .…
2
votes
1 answer

android - notification click shows current activity, if app is closed start new activity

I have an app with a service and ongoing notification and two activities: Activity A and Activity B. Activity A has a button that starts Activity B. When clicking the notification I want the next scenarios to happen: If app closed -> launch the…
2
votes
0 answers

How to detect if heads-up notification is switched off in Marshmallow

From API 23, you can toggle the "Allow peeking" switch to the Off position—to no longer receive heads-up notifications for that app. Settings > Apps > "Select App" > Notifications. Is there a way to detect this in code?
2
votes
0 answers

Preview Notification on android

I'm using this code to show a notification to user from code : Intent intent = new Intent(this, this.getClass()); PendingIntent pi = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationCompat.Builder…
2
votes
2 answers

Sound issue in an android game made in Unity

I have made a 2d game for android in Unity and there is an issue. There are sounds in the game (e.g. menu button sound) that work perfectly. When I leave the game (e.g. with the home button) and come back, the sounds work well, too. But if I get a…
2
votes
5 answers

Launch Activity when notification is clicked

I want to open an Activity when I click on the notification from the Status bar. I have seen this answered on StackOverflow but none of these answers work for me. This is my code: notificationBuilder = new NotificationCompat.Builder(this); …
IrApp
  • 1,823
  • 5
  • 24
  • 42
2
votes
2 answers

Android - Notification BigPictureStyle

I want to display the notification like this but im getting like this Im using the code final Notification notifyDetails = new NotificationCompat.Builder(context) .setContentTitle(mTitle) …
Make it Simple
  • 1,832
  • 5
  • 32
  • 57
2
votes
0 answers

Change notification style

does anyone know how to define style like mediastyle for notifications in android. I want to use different background color for notification that appear on devices who has android version 5.0 or above. I want to use same color, but I want to use…
marko kurt
  • 205
  • 4
  • 12
2
votes
1 answer

how to set the value in custom notification textview

please help me to set the text in textview in custom notification private void startNotification() { String ns = Context.NOTIFICATION_SERVICE; NotificationManager notificationManager = (NotificationManager) getSystemService(ns); …
techandroid07
  • 73
  • 1
  • 8
2
votes
1 answer

Is there any way to customize message "This app won't run unless you update Google Play services" or Skip the message by user choice

We have implemented, GCM ( Google Cloud Messaging ) for sending notifications to App. If the Google Play Service in a particular device, is not the latest as required, the app display the above message on start of App. We have implemented the same…
SHS
  • 1,414
  • 4
  • 26
  • 43
2
votes
0 answers

Onclick of button in custom notification not working

I have a pause button in my notification, on click of which should go to the broadcast receiver. The following is my code: NotificationCompat.Builder builder = new NotificationCompat.Builder(WalkTrackingActivity.this); remoteViews = new…
2
votes
0 answers

Display notification on the condition

The situation is as follows: Depending on certain conditions from time to time sent with intent BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE. Because the user must confirm the action and the phone may be suspended / lying aside etc. I added an…