我的Android應用程序必須能夠發送短的警報了一大羣人。明顯的地方是在通知中心。完整的通知顯示在代碼中沒有問題,但在通知中心,用戶只能看到前幾個單詞,然後看到一個省略號。通知時間不長,最多隻有10-15個字。我怎樣才能讓文字換到新的一行?Android的通知 - 顯示完整的郵件
我的代碼來構建通知是在這裏
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.splash)
.setContentTitle("Student Engauge")
.setContentText(extras.getString("message"))
.setAutoCancel(true)
.setTicker(extras.getString("message"));
final int notificationId = 1;
NotificationManager nm = (NotificationManager) getApplicationContext()
.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(notificationId, mBuilder.build());
次大不前4.1支持自定義通知佈局的限制更多的信息,我想的東西,更支持 – centree 2013-05-09 21:15:58
'的setStyle(新NotificationCompat.BigTextStyle()。bigText(aVeryLongString))' – likejiujitsu 2014-03-11 16:40:55
@centree使用NotificationCompat支持較舊設備上較新的通知功能。 http://developer.android.com/reference/android/support/v4/app/NotificationCompat.html – pmont 2014-04-05 07:25:16