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
0 answers

android Notification bar functioned action button

package com.example.noti; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; // TODO Auto-generated…
Umang
  • 63
  • 10
2
votes
0 answers

Android RemoteView Notification with 3 Buttons having unexpected behavior

I'm creating a custom notification using RemoteView with three buttons and a Label. When I click on a button it is executing the PendingIntent of another. It is very strange. When I click on 4G button it is executing Close PendingIntent When I click…
2
votes
2 answers

When a new notification comes the title and text of old notification gets cleared in android

I am creating an application with a notification at different times. First notification display fine in the notification bar with an icon, title and text. But when the second notification comes the title and text of the first notification gets…
Sumesh P
  • 385
  • 2
  • 10
2
votes
1 answer

Unity3d: Android and iOS Push Notifications

I'm working on a mobile game with Unity and going to use push notifications. I found NotificationServices class that for iOS only. But I didn't find any server-side code examples for that class. I'm asking for any nice examples or solutions…
2
votes
2 answers

The method setColor(int) is undefined for the type NotificationCompat.Builder

I'm working on a simple project which sends push notifications. I wanted to design my notification a bit by setting colors, icons etc. According to Android Developer site, there's a method to NotficationCompat.Builder class called setColor and…
DanielY
  • 1,141
  • 30
  • 58
2
votes
2 answers

Return to currently running activity after clicking on notification

I have the following issue: I wrote an android service - a music player - that runs in the background and launches a notification at startup. Clicking on this notification opens activity A that allows to interact with this player. This works…
2
votes
1 answer

AlarmManager going off whenever app opens

I am trying to set an AlarmManager to go off for a specific time during the day. Here is my current code on it - Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 8); calendar.set(Calendar.MINUTE,…
Matt Southard
  • 71
  • 1
  • 7
2
votes
0 answers

How to set Custom Font to Notification ContentTitle?

I want to add a custom font to Notification Content Title(typeface).I am trying a different ways. Can you guys help me to set the font like news hunt notifications?
Phanikanth
  • 69
  • 2
  • 7
2
votes
1 answer

How to handle multiple intent actions in android notification alarm

My query is that I am trying to redirect the notification intent depending on the different conditions, I am working on the alarm system where I need to redirect the notification intent to some activity say A. If the user clicks it during the alarm…
2
votes
1 answer

Android lollipop recieve media button actions from notification?

I'm trying to create a notification that uses the media button actions, but how do I send and receive those buttons? Here is what I have so far... if(mediaSession==null) { mediaSession = new MediaSession(this, "Boom"); } …
Ael
  • 323
  • 4
  • 14
2
votes
1 answer

Change the icon dynamically in android notification

My icons are having names icon_1, icon_2, icon_3 and so on. And I want to change the icon in the notification dynamically according to the input. The input is a number ranging from 1 to 100. if the input is 1 then icon_1 should be shown, if input is…
Rohit Singhal
  • 429
  • 1
  • 3
  • 17
2
votes
1 answer

Android Notification not shown

I wrote an IntentService for GCM Push Notifications. I receive the Messages but something's wrong with displaying my Notification to the user. Here's my Code: import com.google.android.gms.gcm.GoogleCloudMessaging; import…
2
votes
0 answers

Clearing OnGoing Notifcations From My Application

I have multiple notifications from my application and the notifications are set to ongoing notification. I want to clear the notification when addaction performs on particular notification. I can't know the notification id because these are set…
Jack
  • 89
  • 7
2
votes
1 answer

Is it possible to use a custom (non drawable) smallIcon in an Android notification?

I would like to use an icon via a url as opposed to an already included drawable. Is this possible? The only method signature for setSmallIcon accepts an int for a Drawable resource. However, what can I do if I want to include a smallIcon in the…
StackOverflowed
  • 5,854
  • 9
  • 55
  • 119
2
votes
1 answer

Stacked Wear notification shown on phone too

I have 1 summary-notification and serveral stacked notifications. For some reason the stacked notifications are not only shown on the Andrid Wear device but also on the phone. According to the documentation Stacking Notifications they should only…
1 2 3
99
100