Android.Support.V4.App.NotificationCompat.Builder.SetSmallIcon(int, int)

Here are the examples of the csharp api class Android.Support.V4.App.NotificationCompat.Builder.SetSmallIcon(int, int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

15 Examples 7

1. Example

View license
private void SendNotification()
		{
			var builder =
				new NotificationCompat.Builder(this)
					.SetContentTitle("AltBeacon Reference Application")
					.SetContentText("A beacon is nearby.")
					.SetSmallIcon(Android.Resource.Drawable.IcDialogInfo);

			var stackBuilder = Android.App.TaskStackBuilder.Create(this);
			stackBuilder.AddNextIntent(new Intent(this, typeof(MainActivity)));
			var resultPendingIntent =
				stackBuilder.GetPendingIntent(
					0,
					PendingIntentFlags.UpdateCurrent
				);
			builder.SetContentIntent(resultPendingIntent);
			var notificationManager =
				(NotificationManager)this.GetSystemService(Context.NotificationService);
			notificationManager.Notify(1, builder.Build());
		}

2. Example

View license
void SendNotification()
		{
			NotificationCompat.Builder builder =
					new NotificationCompat.Builder(this)
							.SetContentTitle("Beacon Reference Application")
							.SetContentText("An beacon is nearby.")
							.SetSmallIcon(Resource.Mipmap.Icon);

			var stackBuilder = TaskStackBuilder.Create(this);
			stackBuilder.AddNextIntent(new Intent(this, typeof(MonitoringActivity)));
			PendingIntent resultPendingIntent =
					stackBuilder.GetPendingIntent(
							0,
							PendingIntentFlags.UpdateCurrent
					);
			builder.SetContentIntent(resultPendingIntent);
			NotificationManager notificationManager =
					(NotificationManager)this.GetSystemService(Context.NotificationService);
			notificationManager.Notify(1, builder.Build());
		}

3. Example

View license
void SendNotification() 
		{
			var builder =
				new NotificationCompat.Builder(this)
					.SetContentTitle("AltBeacon Reference Application")
					.SetContentText("A beacon is nearby.")
					.SetSmallIcon(Android.Resource.Drawable.IcDialogInfo);

			var stackBuilder = Android.App.TaskStackBuilder.Create(this);
			stackBuilder.AddNextIntent(new Intent(this, typeof(MainActivity)));
			var resultPendingIntent =
				stackBuilder.GetPendingIntent(
					0,
					PendingIntentFlags.UpdateCurrent
				);
			builder.SetContentIntent(resultPendingIntent);
			var notificationManager =
				(NotificationManager) this.GetSystemService(Context.NotificationService);
			notificationManager.Notify(1, builder.Build());
		}

4. Example

View license
private void StartForeground()
		{
			if (ReturnTo == null)
			{
				return;
			}

			var pendingIntent = PendingIntent.GetActivity(this, 0, new Intent(this, ReturnTo), 0);

			NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
			builder.SetTicker("Seņal Global");
			builder.SetContentTitle("Seņal Global");
			builder.SetContentText("Estas escuchando Seņal Global");
			builder.SetContentIntent(pendingIntent);
			builder.SetOngoing(true);
			builder.SetCategory(Notification.CategoryService);
			builder.SetSmallIcon(Resource.Drawable.icon);

			StartForeground(NotificationId, builder.Build());
		}

5. Example

Project: ediabaslib
Source File: ForegroundService.cs
View license
private void RegisterForegroundService()
        {
            var notification = new NotificationCompat.Builder(this)
                .SetContentTitle(Resources.GetString(Resource.String.app_name))
                .SetContentText(Resources.GetString(Resource.String.service_notification))
                .SetSmallIcon(Resource.Drawable.ic_stat_obd)
                .SetContentIntent(BuildIntentToShowMainActivity())
                .SetOngoing(true)
                .AddAction(BuildStopServiceAction())
                .Build();

            // Enlist this instance of the service as a foreground service
            StartForeground(ServiceRunningNotificationId, notification);
        }

6. Example

View license
protected override void OnHandleIntent(Intent intent)
        {
            if (!CrossConnectivity.C/n ..... /n //View Source file for more details /n }

7. Example

View license
void CreateNotification(string title, string message, int notifyId, string tag, Bundle extras)
     /n ..... /n //View Source file for more details /n }

8. Example

Project: KinderChat
Source File: PushNotifications.cs
View license
private void ShowNotification(Intent intent)
		{
			const string key = "msg";

			if (!intent.Extras/n ..... /n //View Source file for more details /n }

9. Example

View license
public void StartNotification(IMediaFile mediaFile, bool mediaIsPlaying, bool canBeRemoved)
        {
            var icon = (_applicationContext.Resources?.GetIdentifier("xam_mediamanager_notify_ic", "drawable", _applicationContext?.PackageName)).GetValueOrDefault(0);

            _notificationStyle.SetMediaSession(SessionToken);
            _notificationStyle.SetCancelButtonIntent(_pendingCancelIntent);

            _builder = new NotificationCompat.Builder(_applicationContext)
            {
                MStyle = _notificationStyle
            };
            _builder.SetSmallIcon(icon != 0 ? icon : _applicationContext.ApplicationInfo.Icon);
            _builder.SetContentIntent(_pendingIntent);
            _builder.SetOngoing(mediaIsPlaying);
            _builder.SetVisibility(1);

            SetMetadata(mediaFile);
            AddActionButtons(mediaIsPlaying);
            if (_builder.MActions.Count >= 3)
                ((NotificationCompat.MediaStyle)(_builder.MStyle)).SetShowActionsInCompactView(0, 1, 2);
            if (_builder.MActions.Count == 2)
                ((NotificationCompat.MediaStyle)(_builder.MStyle)).SetShowActionsInCompactView(0, 1);
            if (_builder.MActions.Count == 1)
                ((NotificationCompat.MediaStyle)(_builder.MStyle)).SetShowActionsInCompactView(0);

            NotificationManagerCompat.From(_applicationContext)
                .Notify(_notificationId, _builder.Build());
        }

10. Example

View license
public override async void OnReceive(Context context, Intent intent)
        {
            try
     /n ..... /n //View Source file for more details /n }

11. Example

View license
void SendNotification(string message)
        {
            try
            {
                Consol/n ..... /n //View Source file for more details /n }

12. Example

View license
private async void ScheduleToast(Context context, MalNotification notification)
        {
          /n ..... /n //View Source file for more details /n }

13. Example

Project: gMusic
Source File: MediaNotificationManager.cs
View license
Notification CreateNotification()
		{
			if (metadata == null || playbackState == null)
				return n/n ..... /n //View Source file for more details /n }

14. Example

View license
public void OnReceived(IDictionary<string, object> parameters)
        {
            System.Di/n ..... /n //View Source file for more details /n }

15. Example

View license
public void OnReceived(IDictionary<string, object> parameters)
        {
            System.Di/n ..... /n //View Source file for more details /n }