Sub SendNotification(nt As NOTIFY1 , show As Boolean, sound As Boolean)
Dim nb As NotificationBuilder
Dim nbIn As NotificationInboxStyle
Dim v() As Long Dim sb As StatusBarNotification
Dim r As Reflector
Dim p As Phone
Dim myIntent As Intent
' myIntent.Initialize("", "")
' myIntent.SetComponent("com.NotifyMe/.notificationservice")
' myIntent.PutExtra("Notify_Tag", "ClearLast")
nb.Initialize
' nb.setServiceIntent(myIntent)
nb.Priority = 10
nb.AutoCancel = True
nb.Ticker = sb.TickerText
nb.Number = nt.repeat 'notification repeat number
nb.When = nt.ntime 'notification time
nb.DefaultSound = False
nb.CustomSound = aa.sound 'custom sound from app settings
nb.ShowTime = True
nb.ContentTitle = nt.title
nb.ContentText = "(" & nt.repeat & ") " & aa.name & " - " & sb.TickerText
If msgList.Size > 1 Then
nb.SubText = "Swipe down for previous notifications..."
nbIn.Initialize
nbIn.BigContentTitle = "Previous Notifications"
nbIn.SummaryText = actProfile.msg
'some code removed for adding text to the notificationInboxStyle
nb.SetStyle(nbIn)
End If
nb.SmallIcon = actProfile.icon
nb.LargeIcon = LoadBitmap(File.DirAssets, actProfile.icon & ".png")
nb.DefaultLight = False
nb.DefaultVibrate = False
If aa.vibrate = True Then 'vibration on/off defined in app setting
v = Array As Long(0, 100, 300, 500, 300)
nb.CustomVibrate = v
End If
nb.setCustomLight(aa.rgb, aa.lOn, aa.lOff) 'LED color, time ON and time OFF defined in setting
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "power", "java.lang.String")
Dim scnon As Boolean
scnon = r.RunMethod("isScreenOn")
If Not(scnon) Then
If Not(nFlag.Proximity) Then
nFlag.Proximity = phSensor.StartListening("ps") 'proximity sensor events
If nFlag.Proximity = False Then
ToastMessageShow("Proximity Sensor not supported", False)
sensorTmr.Enabled = False
Else
sensorTmr.Enabled = True
End If
End If
End If
'removed code to show toast message
pws.PartialLock
nb.Notify(notifyID1)
End Sub