我是建設和輕鬆的Android應用程序。 我遇到了通知問題。當應用程序收到通知時,它會正確地顯示所有圖片和文本,而在鎖定屏幕上,如果手機已鎖定,則不會顯示文本。要查看文本,我必須向下滑動通知。鎖屏通知文本
這是代碼:
NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
bigText.bigText(body);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.ic_stat_luceterna_notifica_90)
.setContentTitle("Luceterna")
.setLargeIcon((((BitmapDrawable) this.getResources().getDrawable(R.mipmap.ic_launcher_lux)).getBitmap()))
.setAutoCancel(true)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
mBuilder.setStyle(bigText);
Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
mBuilder.setSound(alarmSound);
NotificationManager mNotificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
可以請人幫助我嗎?我找不到任何問題的答案。
在此先感謝。
對不起,我忘了最後的代碼行:mNotificationManager.notify(MESSAGE_NOTIFICATION_ID,mBuilder.build()); –