Android Question An issue of app self update for help

teddybear

Well-Known Member
Licensed User
The code is from https://www.b4x.com/android/forum/attachments/1-zip.84220/
The normal update process is ok。
B4X:
Sub Service_Start (StartingIntent As Intent)
    If StartingIntent.Action = "android.intent.action.MY_PACKAGE_REPLACED" Then
        LogColor ("App self updated OK",Colors.Yellow)
        StartActivity(Main)
    End If
    Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
End Sub
Start package replaced intent, after confirm and updating package, stop process and restart app.
in this case , it works correctlly

After I cancelled the intent of package updated , the app would restart but process did not stop, two instances of app were running.

how to stop restarting the app after I cancelled the intent?
 
Top