marcick Well-Known Member Licensed User Longtime User Jun 2, 2015 #1 Hi guys, after I have downloaded and started an update fo rmy app using this code, is it possible to auto start it ? Code: Copy Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk")) i.SetType("application/vnd.android.package-archive") StartActivity(i)
Hi guys, after I have downloaded and started an update fo rmy app using this code, is it possible to auto start it ? Code: Copy Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "temp.apk")) i.SetType("application/vnd.android.package-archive") StartActivity(i)
Erel B4X founder Staff member Licensed User Longtime User Jun 2, 2015 #2 Try to add a static intent filter that listens to: android.intent.action.PACKAGE_REPLACED Upvote 0
marcick Well-Known Member Licensed User Longtime User Jun 2, 2015 #3 Hi Erel, I see. That code in the manifest will start a service in my app. Inside the service, do I have to add a StartActivity "Main" ? .. Upvote 0
Hi Erel, I see. That code in the manifest will start a service in my app. Inside the service, do I have to add a StartActivity "Main" ? ..
Erel B4X founder Staff member Licensed User Longtime User Jun 2, 2015 #4 marcick said: do I have to add a StartActivity "Main" ? Click to expand... Yes. Upvote 0
marcick Well-Known Member Licensed User Longtime User Jun 2, 2015 #5 Uhm .. seems not to work. I have added this in the Manifest Code: Copy AddReceiverText(AppUpdate, <intent-filter> <action android:name="android.intent.action.PACKAGE_REPLACED" /> <data android:scheme="package" /> </intent-filter>) Then I have created a service "AppUpdate" with the code: Code: Copy Sub Service_Start (StartingIntent As Intent) Log(StartingIntent.GetData) StartActivity(Main) StopService("") End Sub But nothing happens after the installation is completed [EDIT] I see the service is started, but the StartActivity(Main) does not have the effect os starting the app Last edited: Jun 2, 2015 Upvote 0
Uhm .. seems not to work. I have added this in the Manifest Code: Copy AddReceiverText(AppUpdate, <intent-filter> <action android:name="android.intent.action.PACKAGE_REPLACED" /> <data android:scheme="package" /> </intent-filter>) Then I have created a service "AppUpdate" with the code: Code: Copy Sub Service_Start (StartingIntent As Intent) Log(StartingIntent.GetData) StartActivity(Main) StopService("") End Sub But nothing happens after the installation is completed [EDIT] I see the service is started, but the StartActivity(Main) does not have the effect os starting the app