Changing LED color for notifications

前端 未结 8 1975
囚心锁ツ
囚心锁ツ 2020-12-04 15:56

I am basically just experimenting with Android development, and a couple of days ago I came across this app called \"Go SMS Pro\", which, among other things, can set up noti

8条回答
  •  一生所求
    2020-12-04 16:32

    Have a look on source below.

    NotificationCompat.Builder mBuilder =
                    new NotificationCompat.Builder(ctx)
                            .setPriority(Notification.PRIORITY_HIGH)
                            .setSmallIcon(getNotificationIcon())
                            .setColor(0xff493C7C)
                            .setContentTitle(ctx.getString(R.string.app_name))
                            .setContentText(msg)
                            .setDefaults(Notification.DEFAULT_SOUND)
                            .setLights(0xff493C7C, 1000, 1000)
                            .setStyle(new NotificationCompat.BigTextStyle().bigText(styledMsg));
    

提交回复
热议问题