Reputation: 24717
My app is installing an APK like so:
Intent install = new Intent(Intent.ACTION_VIEW);
install.setDataAndType(Uri.fromFile(f), "application/vnd.android.package-archive");
PendingIntent pint = PendingIntent.getActivity(this, 0, install, 0);
The PendingIntent is passed to a notification as the Content Intent so tapping it will install the APK. This works and brings up the system app installer interface with the permissions and all that. The user can cancel it or back out of it. How can I know if the install actually happened or if it was aborted?
Upvotes: 0
Views: 414
Reputation: 5256
I imagine, you could use a Receiver with an intent-filter for ACTION_PACKAGE_ADDED
http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_ADDED
Upvotes: 1