Sets whether the notification sound and/or vibration should sound each time the notification is sent, even if it has not been cancelled before.
AutoCancelAsBoolean [write only]
Sets whether the notification will be cancelled automatically when the user click on it
Cancel (IdAsInt)
Cancels the notification with the given Id
DefaultLEDAsBoolean [write only]
Sets whether the notification will Flash the LED (if available) using the Default settings.
NOTE: Setting to True will over rule the CustomLED
Example: n.DefaultLED = False
DefaultSoundAsBoolean [write only]
Sets whether the notification will play a sound using the default settings Example: n.DefaultSound = True
DefaultVibrateAsBoolean [write only]
Sets whether the notification will vibrate using the default settings
NOTE: Setting to True will overrule the CustomVibrate
Example: n.DefaultVibrate = True
Initialize (LayoutAsInt)
Initializes the notification setting default values of: LED = Enabled Sound = Enabled Vibration = Enabled Layout - Sets the layout to be used. Options: 1 = Default notification layout (Two Text fields plus Icon) 2 = Two Text fields plus One Image 3 = One Text field plus One Image plus One Progress Bar 4 = Two Text fields ONLY 5 = User Defined. Add your xml file to the res/layout. Name it mylayout.xml and make it read only.
Example: cn.Initialize(2) 'Initializes the notification and sets the layout to Two Text fields plus One Image
InsistentAsBoolean [write only]
Sets whether the sound will play repeatedly until the user opens the notification screen
IsInitializedAsBoolean
NoClearAsBoolean [write only]
Sets whether the notification should NOT be cancelled when the user clicks the Clear All button. Example:
Dim cn as CustomNotification
cn.NoClear = True 'Notification will not clear.
Notify (IdAsInt)
Displays the notification. Id: - The notification Id. This can be used later to update the notification (by calling notify again with the same Id) or cancel it.
NumberAsInt
Gets or Sets a number that will be displayed over the icon. This is useful to represent multiple events in a single notification.
OnGoingEventAsBoolean [write only]
Set if the notification is in reference to an ongoing event, e.g. a phone call. Do not set for notifications that are in reference to something that happened at a particular point in time.
setCustomLED (LightOnAsInt, LightOffAsInt)
Set a custom timing for the notification Light. Timings are in milliseconds.
NOTE: DefaultLED must be set to False.
Example: Dim cn as CustomNotification
cn.DefaultLED = False cn.CustomLED(300, 1000)
SetCustomSound (pathAsString)
Sets a custom sound to be played on new notification
Sets A custom vibrate sequence for notification Vibration The Array of values can be as long as you wish. The First Value is the pause before vibration starts, then it's ON, OFF, ON, OFF, etc.
NOTE: DefaultVibrate must be set to False
Example: Dim cn as CustomNotification Dim v() as Long
v = Array as Long(0, 100, 200, 300, 400) cn.DefaultVibrate = False cn.CustomVibrate(v)
setIcon (FileNameAsString)
Sets the icon to be displayed. The image file should manually copied to the Objects\res\drawable\ folder and set to read-only. The file name is case sensitive and should not contain the file extension. You can use "icon" to use the applications icon.
Sets image used in a notification. Only use with "twotextsplusimage" and "onetextplusimageplusprogress" Presets or if defined as part of a user defined layout. For Preset layout the id is "image".
SetIntent (ActivityAsObject)
Sets the Activity that is called when the user clicks the notification Example: cn.Activity(Main)
Sets the parameters for a progress bar used in a notification. Only use with "onetextplusprogress" Preset or if defined as part of a user defined layout. For Preset layout the id is "progress".
maxProgress - the upper limit of the progress bar. A good value is 100 progress - the current level of progress to be shown. Must be <= maxProgress.
SetTag (TagAsString)
The Tag is a string that can be extracted later on Activity_Resume. This can be used to determine which notification has been clicked by the user when multiple notifications exist.
Example of extracting the Tag: Sub Activity_Resume Dim in as Intent Dim intentExtra as String
in = Activity.GetStartingIntent If in.HasExtra("Notification_Tag") Then intentExtra = in.GetExtra("Notification_Tag") End If End Sub
SetText (idAsString, textAsString)
Sets the content of text items for the notification For Preset Layouts the id's are "title" and "text". Example:
cn.SetText("title", "New notification") cn.SetText("text", "You have a new notification")
SetTextColor (idAsString, ColorAsInt)
Sets the Color of a text item. For Preset Layouts the id's are "title" and "text". Example:
cn.SetText("title", "New notification") cn.SetTextColor("title", Colors.Red)
SetTextSize (idAsString, ValueAsInt)
Sets the text size of a text item. For Preset Layouts the id's are "title" and "text". Example:
cn.SetText("title", "New notification") cn.SetTextSize("title", 20)
TickerTextAsString [write only]
Sets the Ticker Text which shows along side the status bar icon on new notification.
Example: cn.TickerText = "New notification"
WhenAsLong
Note: Experimental Feature The offical description of this method is - The timestamp for the notification.
Setting this to the max Value for a long (9,223,372,036,854,775,807) pushes the Notification Icon to the right.
Top