Android: receipt of intent sent by ACTION_PACKAGE_RESTARTED

I am new to android. I am completely stuck in using ACTION_PACKAGE_RESTARTED in my application

I removed pacakge from my emulator, also added using adb install, but received nothing. Launch the app. close it and run this application again. nothing works for me. Logcat is not registered.

Is there anything that I am missing? Please, help

public class RestartReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
    String action= intent.getAction();
    Log.i("D", "Inside receiver");
}

And here is the manifest file

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <receiver android:name=".ReceiverTest">
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_REMOVED" />
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <action android:name="android.intent.action.ACTION_PACKAGE_RESTARTED" />
        </intent-filter>
    </receiver>

</application>
+3
source share
2 answers

the value specified in the intent filter is incorrect .. actual value

<action android:name="android.intent.action.PACKAGE_RESTARTED" />

and this translation can only be obtained for other packages. The reloaded application / package does not receive this broadcast.

+1
source

-:

<data android:scheme="package" />
0

All Articles