0
所以我正在学习在xamarin android中使用BigTextStyle进行通知。由于某种原因,每当我运行我的代码时,bigText和SetSummaryText都没有出现在通知中。有人知道为什么我的代码如下:Notification.BigTextStyle没有出现
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
Notification.Builder builder = new Notification.Builder(this)
.SetContentTitle("Big Text")
.SetSmallIcon(Resource.Drawable.Icon);
Notification.BigTextStyle textStyle = new Notification.BigTextStyle();
string longTextMessage = "I went up on one pair of stairs.";
longTextMessage += "/Just like me. ";
textStyle.BigText(longTextMessage);
textStyle.SetSummaryText("The summary text goes here. ");
builder.SetStyle(textStyle);
Notification notification = builder.Build();
NotificationManager notificationManager =
GetSystemService(Context.NotificationService) as NotificationManager;
const int notificationId = 0;
notificationManager.Notify(notificationId, notification);
}
这也不能工作。我在运行android 4.4的Samsung Galaxy 4上调试它。 – user2626734
没关系,它的工作!谢谢。 – user2626734