Skip to content Skip to sidebar Skip to footer

Launch Application After Packageinstaller Finished (self) Updating

After the PackageInstaller successfully (self) updates the application, the application closes and doesn't launch again. Possible duplicate: Android PackageInstaller, re-open the a

Solution 1:

The MY_PACKAGE_REPLACEDIntent is broadcast by Android after your app is updated.

To restart your app after the update, you could pass a launch Intent to the PackageInstaller, like this:

Intentintent= getPackageManager().getLaunchIntentForPackage("my.package.name");
PendingIntentpendingIntent= PendingIntent.getActivity(
                mContext.get(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
session.commit(pendingIntent.getIntentSender());

This should cause your app to be restarted after the update is completed.

Solution 2:

While David Wasser's answer was probably the right one. I am closing my case because I'm having very strange and undefined behaviour, and I am pretty sure that's because I am using a custom ROM

Post a Comment for "Launch Application After Packageinstaller Finished (self) Updating"