0

I've completed a class to download the new version of an apk and install it programmatically using the following code

Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/"  + ApkName)), "application/vnd.android.package-archive");
context.startActivity(intent);  

It works, it installs the new apk (previously downloaded on SD) but then the app is not restarted but closed.

There is a way to have it restarted after the installation of the new version?

Thanks!

shaman74
  • 127
  • 2
  • 8
  • Check this : http://stackoverflow.com/questions/17911412/autoshow-mainactivity-after-install/17911519#17911519 – EvZ Aug 07 '13 at 08:51
  • So is it correct that after installing the new version the app exits with no message to the user (something like 'installation succesful')? – shaman74 Aug 07 '13 at 08:55
  • 1
    When you re-installing APK, it kill's the previous running processes related to the old version before installing the new APK. – EvZ Aug 07 '13 at 08:57

0 Answers0