Running Android System Apps from Custom Admin App
I am writing an Admin开发者_StackOverflow App that will download the latest updated app from my website and install. The only way to do the install that I have found is to invoke the package installer using a starActivity(). Passing control over to the System Installer app makes perfect sense, but it also interferes with the user experience of the admin app. How can I keep the user inside my admin app while interacting with the System Installer app? Or at least return to my Admin app after they exit the System Installer app? This question really applies anytime you need to pop up a system app to do something. How do you preserve the user experience of the app that launches the system app?
You cannot install applications without the system installer, it would be a serious security risk - you could bypass showing the list of required permissions. (On rooted devices, it is possible via filesystem operations).
Users can return to your application via the back key after install (see this article about task and activity stacks). If I remember correctly, closing the installer with the "Done" button will also have the same result, try it with Astro).
精彩评论