Tuesday, January 17, 2012

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

1 comment:

  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