void HandleTimerCallback(object state) { var preferences = PreferenceManager.GetDefaultSharedPreferences(this); var streamerNames = preferences.GetString("streamer_names", "").Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); var streamersOnline = Twitch.StreamersOnline(streamerNames, configuration); foreach (var entry in streamersOnline) { if (!entry.Value) { continue; } Bundle valuesForActivity = new Bundle(); Intent resultIntent = new Intent(this, typeof(MainActivity)); resultIntent.PutExtras(valuesForActivity); TaskStackBuilder stackBuilder = TaskStackBuilder.Create(this); stackBuilder.AddParentStack(Java.Lang.Class.FromType(typeof(MainActivity))); stackBuilder.AddNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.GetPendingIntent(0, (int)PendingIntentFlags.UpdateCurrent); NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .SetAutoCancel(true) .SetContentIntent(resultPendingIntent) .SetContentTitle("Streamer online") .SetSmallIcon(Resource.Drawable.Icon) .SetContentText(entry.Key + " is streaming now"); NotificationManager notificationManager = (NotificationManager)GetSystemService(NotificationService); notificationManager.Notify(ButtonClickNotificationId, builder.Build()); } }