在Add a Big View Google上展示了如何使用BigTextStyle。截图看起来很有希望:
我玩了一些来自NotificationCompat.BigTextStyle的setter,我可以总结一些被忽略的东西。似乎是一个错误?!
final NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender()
.setBackground(BitmapFactory.decodeResource(context.getResources(), R.drawable.chalk));
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("title")
.setContentText("text") // overwritten by bigText()
.setStyle(new NotificationCompat.BigTextStyle()
.bigText("big text")
.setBigContentTitle("big content title") // ignored
.setSummaryText("summary text")) // ignored
.setContentIntent(viewPendingIntent)
.extend(wearableExtender);
final NotificationManagerCompat manager = NotificationManagerCompat.from(context);
manager.notify(notificationId, builder.build());
答案 0 :(得分:2)
Html似乎有效:
.setContentText(Html.fromHtml("<b>Best</b> restaurant <i>in</i> <font color=\"#0000ff\">San</font> Francisco <a href=\"http://www.stackoverflow.com\">#food"))
这是一个有用的链接:HTML Tags Supported By TextView