I want to stop my timer once my activity closes,,
Right now I create an activity that checks a service every 20 seconds for if there is an update. If there is it will send a notification with the same activity, if it gets clicked on it will open the same activity(So the one with the timer)
I tried using:
resultIntent.SetFlags (ActivityFlags.SingleTop);
[Activity (LaunchMode = LaunchMode.SingleTop, NoHistory = true) ] // Creates the Launchmode single top and set the nohistory true in the androidmanifest
But that did still create a new activity, with a new timer and a new oncreate ( Giving a variable that tells me in the oncreate if it's the first or not won't work because the timerevent is also checking if activity is paused or not, what I can't do if the timer event is in another activity than the open one)
So I couldn't get it working that it would open the current active activity instead of a new one, but now I want to look into stopping the other(Actually same class) activity's timer, so it won't trigger the notification if there's a newer one up.