If File.Exists(File.DirRootExternal,"dir/dir/..../setup.apk") Then
'if there is a new apk, installs it
Dim iIntent As Intent
iIntent.Initialize(iIntent.ACTION_VIEW,"file:///sdcard/dir/dir/..../setup.apk")
iIntent.SetType("application/vnd.android.package-archive")
StartActivity(iIntent)
'I have to wait for user click on the setup confirmation - There are other solutions??
Sleep(SetupInterval * DateTime.TicksPerSecond)
Dim in As Intent
in.Initialize(in.ACTION_MAIN, "")
in.SetComponent("package_name")
'Problem
'if user clicks on Cancel, and then clicks on Android Settings button (in tray), this row is executed but it doesn't work!!
StartActivity(in)
Else
'if there isn't an update, it starts the app
Dim in As Intent
in.Initialize(in.ACTION_MAIN, "")
in.SetComponent("package_name")
StartActivity(in)
End If