沒梗了 隨便寫
val title = "testTitle"
val message = "testMessage"
private fun sendSimplenotify(title:String,message: String) {
val notiMgr = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val noti = NotificationCompat.Builder(this).setSmallIcon(R.drawable.icon).setContentTitle(title).setContentText(message)
val note = noti.build()
note.vibrate = longArrayOf(100,250,100,500)
note.ledARGB = Color.RED
note.flags != Notification.FLAG_SHOW_LIGHTS
note.ledOnMS = 200
note.ledOffMS = 300
notiMgr.notify(NOTIF_ID,note)
val intent = Intent(this,MainActivity::class.java)
intent.putExtra("NOTIFICATION_ID",NOTIF_ID)
val pIntent = PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_UPDATE_CURRENT)
noti.setContentIntent(pIntent)
// notiMgr.notify(NOTIF_ID,noti.build())
}
簡單的就出來了 三十天完成 病都還沒好 病比code難搞