4

I have a notification that displays in the status bar. If the user is on the home screen, the ticker text that goes along with the notification is shown. If the user is on the lock screen, the notification icon is shown, but the ticker text is not shown. How can I make the ticker text show even if the user is on the lock screen?

EDIT: The lock screen ticker text works correctly in the emulator (2.3.3, 4.0.3, and 4.1.2), but it doesn't work on the 2 test devices I have (Galaxy S3 running 4.0.4 and Galaxy Tab running Honeycomb).

EDIT 2: The strange thing is that I have tested text messaging on the S3 and ticker text is successfully shown. However this could be because it was a native messaging app and Samsung has disabled this with 3rd party apps?

NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                .setSmallIcon(R.drawable.launch_icon)
                .setTicker("My ticker text")
                .setContentTitle(title)
                .setContentText(message)
                .setContentIntent(contentIntent);
4

1 回答 1

0

迟到的回答/评论,但在我的设备(运行 4.4 的 Galaxy s2)的锁定屏幕中显示了代码。使用 NotificationCompat.Builder

于 2013-11-26T10:37:50.840 回答