Android 通知文本太长,未显示全文

Android 通知文本太长,未显示全文,android,notifications,Android,Notifications,我正在为android 2.3.3开发一个应用程序。我正在显示通知,但此通知的文本太长,未显示全文,且已被剪切,因此如何在通知中显示全文 代码如下: String message = "Tonights Taraweeh consists of Alif Lam Mim and the first quarter of Sayaqul. The Surahs covered are Al-Fatiha(The Opening),and the first two-thirds of Al-Baq

我正在为android 2.3.3开发一个应用程序。我正在显示通知,但此通知的文本太长,未显示全文,且已被剪切,因此如何在通知中显示全文

代码如下:

String message = "Tonights Taraweeh consists of Alif Lam Mim and the first quarter of Sayaqul. The Surahs covered are Al-Fatiha(The Opening),and the first two-thirds of Al-Baqara(The Cow).";
Notification notification = new Notification();
notification.setLatestEventInfo(context, title, message, contentIntent);

扩展通知仅在Android 4.1中提供


Android 2.3.3使用旧的通知而不进行扩展。如果在Android 4.1或更早版本中显示通知,您必须使用较短的文本、剪切文本(并在用户单击时显示全文)或调整文本。

I short您必须设置
BigTextStyle

Notification notification = new NotificationCompat.Builder(context, CHANNEL_ID)
            .setSmallIcon(R.drawable.new_mail)
            .setContentTitle(emailObject.getSenderName())
            .setContentText(emailObject.getSubject())
            .setLargeIcon(emailObject.getSenderAvatar())
            .setStyle(new NotificationCompat.BigTextStyle()
                    .bigText(__BigTextHere___))
            .build();

请出示一些代码。您必须提供您的代码以便我们能够帮助您。是的,请出示您的相关代码部分。你是通过吐司秀的吗?如果是的话,在祝酒词上显示长文本是不好的做法,因为如果用户触摸屏幕上的任何地方,祝酒词都可以由用户完成。这可能在用户无意中发生。AlertDialog是更好的解决方案+1@CRUSADER指出解决方案。不幸的是,这表明人们搜索答案的方式不好,因为这样的问题已经得到了回答。