Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun fireNotification() {
- var anotherIntent:Intent=Intent(this,ReminderActivity::class.java)
- var p1:PendingIntent= PendingIntent.getActivity(this,0,anotherIntent,0)
- val defaultSoundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
- var notifyManager: NotificationManager =getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
- var notification:Notification=NotificationCompat.Builder(this)
- .setContentTitle("Medicine Time")
- .setSmallIcon(R.mipmap.ic_launcher)
- .setSound(defaultSoundUri)
- .setContentText("Time to take your medicine")
- .setContentIntent(p1)
- .setAutoCancel(true)
- .build()
- notifyManager.notify(0,notification)
- }
Add Comment
Please, Sign In to add comment