Android 技巧 - notification center 发出通知时显示文字

来源:互联网 发布:心知天气 融资 编辑:程序博客网 时间:2024/06/04 19:17


this.mBuilder =
       new NotificationCompat.Builder(this)
       .setSmallIcon(R.drawable.ic_launcher)
       .setContentTitle("My notification")
       .setLargeIcon(largeIcon)
       .setAutoCancel(true)
       .setTicker("This is a notification")
       .setContentText("Hello World!");

--------------

The NotificationCompat.Builder class has method setTicker() that allows you to do that.

0 0
原创粉丝点击