Detect cancellation of user actions during apk software installation

my question is: How to determine when the user cancels the apk installation? My installation code:

Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); BroadcastReceiver br = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); // detect if user install apk } }; IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_PACKAGE_ADDED); filter.addAction(Intent.ACTION_PACKAGE_CHANGED); filter.addAction(Intent.ACTION_PACKAGE_REMOVED); filter.addCategory(Intent.CATEGORY_DEFAULT); filter.addDataScheme("package"); context.startActivity(intent); 

This way I can detect when the user has installed / updated the package, but cannot detect when the user cancels the apk installation operation. How to solve this?

+7
android
source share

No one has answered this question yet.

See related questions:

687
Android error: Failed to install * .apk on device *: timeout
439
INSTALL_FAILED_NO_MATCHING_ABIS when installing apk
272
Android: install .apk program code
58
Android install apk with Intent.VIEW_ACTION does not work with file provider
7
No connection with VPN?
2
How to getAssets in a service?
2
Show PDF in application
one
Broadcast receiver does not work when application is closed (from everywhere)
one
How to get recycled to broadcast the receiver?
0
How to programmatically start a new job to complete a package installer?

All Articles