Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Create notification
- var notificationManager = GetSystemService(Context.NotificationService) as
- NotificationManager;
- //Create an intent to show ui
- var uiIntent = new Intent(this, typeof(MainActivity));
- //Create the notification
- var notification = new Notification(Resource.Drawable.Icon, "Tienes notificación");
- //var notification = new Notification(Android.Resource.Drawable.SymActionEmail,title);
- //Auto cancel will remove the notification once the user touches it
- notification.Flags = NotificationFlags.AutoCancel;
- //Set the notification info
- //we use the pending intent, passing our ui intent over which will get called
- //when the notification is tapped.
- notification.SetLatestEventInfo(this,"Tienes nueva notificación", "Te ha enviado una solicitud de contacto", PendingIntent.GetActivity(this, 0, uiIntent, 0));
- //Show the notification
- notificationManager.Notify(1, notification);
Add Comment
Please, Sign In to add comment