ACTION_MY_PACKAGE_REPLACED not received
- by Ton
I am using ACTION_MY_PACKAGE_REPLACED to receive when my app is updated or resinstalled.
My problem is that the event is never triggered (I tried Eclipse and real device).
This is what I do:
Manifest:
<receiver android:name=".MyEventReceiver" >
<intent-filter android:priority="1000" >
<action android:name="android.intent.action.ACTION_MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
Code:
public class MyEventReceiver extends BroadcastReceiver
{
@Override public void onReceive(Context context, Intent intent)
{
if ("android.intent.action.ACTION_MY_PACKAGE_REPLACED".equals(intent.getAction()))
{ //Restart services
}
}
}
This code is simple, in real one I used other events like BOOT_COMPLETED and others, and they work but ACTION_MY_PACKAGE_REPLACED.
Thanks.