我試圖在Android中使用Xamarin.Android創建自定義通知。我創建的通知不會在不同的設備上顯示相同的通知。這是我正在使用的代碼:自定義通知Android在不同設備上顯示不一樣
Notification.Buider not = new Notification.Builder(this)
.SetTicker("Service started")
.SetContentTitle("This is the title")
.SetContentText("This is the content")
.SetSmallIcon(Resource.Drawable.Icon);
Notification notification = not.Build();
notification.BigContentView=rv;
NotificationManager manager = GetSystemService(Context.NotificationService) as NotificationManager;
manager.Notify(0,notification);
如果我在聯想A319(其運行Android 4.4.2)的通知是顯示不膨脹的rv
變量,而如果我上運行的應用程序運行此Samsung Galaxy S7(Android 6.0.1)通知顯示爲rv
變量中的佈局正在描述它。
我想知道爲什麼通知在不同的設備上顯示不一樣。它是由android版本引起的還是有我的代碼有問題?
能告訴你的通知看起來像在不同的設備? –
我編輯了這個問題。 –
哪一個是你的通知?我在第一張圖片上看到「這是標題」,但在第二張圖片上? –