Sub Service_Start (StartingIntent As Intent)
Log("intent: " & StartingIntent)
Log("starting intent: " & StartingIntent.GetData)
Log("extras: " & StartingIntent.ExtrasToString)
If StartingIntent.Action = "android.intent.action.PACKAGE_REPLACED" And IsPaused(Main) Then
Log("restarting main Activity...")
MyAppReload
Else
StartServiceAt("", DateTime.Now + 5 * 1000, True)
End If
End Sub
Sub Service_Destroy
End Sub
Sub MyAppReload
If IsPaused(Main) Then
Log("restarting Main Activity...")
StartActivity(Main)
StopService("")
End If
End Sub