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!