Example usage for android.content Intent ACTION_PACKAGE_RESTARTED

List of usage examples for android.content Intent ACTION_PACKAGE_RESTARTED

Introduction

In this page you can find the example usage for android.content Intent ACTION_PACKAGE_RESTARTED.

Prototype

String ACTION_PACKAGE_RESTARTED

To view the source code for android.content Intent ACTION_PACKAGE_RESTARTED.

Click Source Link

Document

Broadcast Action: The user has restarted a package, and all of its processes have been killed.

Usage

From source file:me.piebridge.prevent.framework.SystemReceiver.java

private void handlePackage(Intent intent, String action) {
    String packageName = PackageUtils.getPackageName(intent);
    if (Intent.ACTION_PACKAGE_RESTARTED.equals(action)) {
        handlePackageRestarted("PACKAGE_RESTARTED", packageName);
    } else if (Intent.ACTION_PACKAGE_ADDED.equals(action)) {
        onPackageAdded(intent);/*from   w ww.j av a2s .  c om*/
    } else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
        onPackageRemoved(intent);
    }
}

From source file:me.piebridge.prevent.ui.PreventActivity.java

@Override
protected void onResume() {
    super.onResume();
    IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_RESTARTED);
    filter.addDataScheme("package");
    registerReceiver(receiver, filter);//from  ww  w  .ja  v  a 2s .c  o m
}