public class Notification
extends java.lang.Object
LocalNotificationsService
.LocalNotificationsService
Constructor and Description |
---|
Notification(java.lang.String id,
java.lang.String title,
java.lang.String text,
java.io.InputStream imageInputStream,
java.time.ZonedDateTime dateTime,
java.lang.Runnable runnable)
Creates a new Notification instance with the specified id, title, text, and image, set to be displayed on the
users device as the given date/time, and when clicked will execute the given Runnable.
|
Notification(java.lang.String id,
java.lang.String title,
java.lang.String text,
java.time.ZonedDateTime dateTime,
java.lang.Runnable runnable)
Creates a new Notification instance with the specified id, title, and text, set to be displayed on the users device as
the given date/time, and when clicked will execute the given Runnable.
|
Notification(java.lang.String id,
java.lang.String text,
java.time.ZonedDateTime dateTime,
java.lang.Runnable runnable)
Creates a new Notification instance with the specified id and text, set to be displayed on the users device as
the given date/time, and when clicked will execute the given Runnable.
|
Modifier and Type | Method and Description |
---|---|
java.time.ZonedDateTime |
getDateTime()
The
ZonedDateTime with the time when the notification is scheduled |
java.lang.String |
getId()
The id of the notification.
|
java.io.InputStream |
getImageInputStream()
The
InputStream with an image for the notification's logo |
java.lang.Runnable |
getRunnable()
A runnable to be executed when the notification is displayed and clicked
by the user on the device
|
java.lang.String |
getText()
The content of the notification
|
java.lang.String |
getTitle()
The title of the notification
|
public Notification(java.lang.String id, java.lang.String text, java.time.ZonedDateTime dateTime, java.lang.Runnable runnable)
id
- The unique ID of this notification. It should remain the same through multiple executions of the application.text
- The text to show in the native notification popup.dateTime
- The date and time to show the notification.runnable
- The code to run when the user clicks on the notification.public Notification(java.lang.String id, java.lang.String title, java.lang.String text, java.time.ZonedDateTime dateTime, java.lang.Runnable runnable)
id
- The unique ID of this notification. It should remain the same through multiple executions of the application.title
- The title text to show in the native notification popup.text
- The text to show in the native notification popup.dateTime
- The date and time to show the notification.runnable
- The code to run when the user clicks on the notification.public Notification(java.lang.String id, java.lang.String title, java.lang.String text, java.io.InputStream imageInputStream, java.time.ZonedDateTime dateTime, java.lang.Runnable runnable)
id
- The unique ID of this notification. It should remain the same through multiple executions of the application.title
- The title text to show in the native notification popup.text
- The text to show in the native notification popup.imageInputStream
- An input stream containing image data that can be displayed in the native notification popup.dateTime
- The date and time to show the notification.runnable
- The code to run when the user clicks on the notification.public final java.lang.String getId()
public final java.lang.String getTitle()
public final java.lang.String getText()
public final java.io.InputStream getImageInputStream()
InputStream
with an image for the notification's logopublic final java.time.ZonedDateTime getDateTime()
ZonedDateTime
with the time when the notification is scheduledpublic final java.lang.Runnable getRunnable()