C#を使用してMonoDroidでステータスバー通知を表示するにはどうすればよいですか?MonoDroidでステータスバー通知を表示するC#
誰かが私に例を挙げることはできますか?
ありがとうございました。
C#を使用してMonoDroidでステータスバー通知を表示するにはどうすればよいですか?MonoDroidでステータスバー通知を表示するC#
誰かが私に例を挙げることはできますか?
ありがとうございました。
あなたはLocalService.ShowNotification()から例えば、Android.App.NotificationとAndroid.App.NotificationManagerを使用したい:
// within some Android.Content.Context subclass (Activity, Service, etc.)
void ShowNotification()
{
IEnumerable<char> text = GetText (Resource.String.local_service_started);
var notification = new Notification (Resource.Drawable.stat_sample,
text,
System.Environment.TickCount);
PendingIntent contentIntent = PendingIntent.GetActivity (this, 0,
new Intent (this, typeof (LocalServiceActivities.Controller)),
0);
notification.SetLatestEventInfo (this,
GetText ([email protected]_service_label),
text,
contentIntent);
var nm = (NotificationManager) GetSystemService (NotificationService);
nm.Notify (Resource.String.local_service_started, notification);
}
あなたが詳細を参照するためのリンク、などのページの下に見ることができます: https://www.facebook.com/pages/M%C3%A3-Ngu%E1%BB%93n/371039113001844
はPushSharpをお試しください: https://github.com/Redth/PushSharp
それは私にとって素晴らしい仕事でした。
例としてコードを追加してください。 – Amit