Skip to main content

android, uninstall and install into the same activity?



I am trying to do an upgrade version process for apk files ...





How can i do to run uninstall and install Intent calls into the same activity?





If i do , uninstall intent,







Uri packageURI = Uri.parse("package:" + paqueteId);

Intent uninstallIntent = new Intent(Intent.ACTION_DELETE,packageURI);

startActivityForResult(uninstallIntent, RESULT_OK);







is there anyway to wait for the uninstall finish and then continue running the activity code ... and then launch the install intent ???





thank you


Comments

  1. You could register a broadcast reciever for ACTION_PACKAGE_REMOVED and wait for this, on this intent being called you could start the install

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?