i have a service that runs in startforeground mode
the service initialize a notification icon
if i put that code into a Activity_resume event (Main Activity), it is executed also when change the orientation and also if resume application from task button
You should use SetInfo2 to set a tag to the notification. Add a process global variable of type Intent and add this code:
B4X:
Sub Activity_Resume
If PrevIntent <> Activity.GetStartingIntent Then
'check the tag
Else
'do nothing as it is an old intent
End If
PrevIntent = Activity.GetStartingIntent