I have created a lock screen for ICS and it is placed in the frameworks and we can open applications using this. For the user effects I have started an animation when the lock screen is displayed. This animation is started using SCREEN_ON broadcastereceiver. But when the phone is booting up even though I registered broadcastereceiver it is not reaching to onReceive() and the animation is not starting. While phone bootup is taking place I thought that this broadcast is not having higher priority to execute and set the priority as high but it is also not working.
问题:
回答1:
Check this out.. I also had the same problem Broadcast not invoking:
According to my knowledge the problem is with Android HoneyComb and ICS. I have tested same application on HoneyComb,ICS, Ginger Bread and Froyo. Worked perfectly for Froyo and Ginger bread but not for honeycomb or ics.
回答2:
if you are just shutting down your phone and switching it on, then you might not get this broadcast. try to restart your phone. this would work.
you havent added any code in your question, so it woulld be really difficult to guess what you are missing and what probably is going wrong.
回答3:
Well the way to receive system startup is as follows
Register receiver in manifest:
<receiver android:name=".StartupReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
Use the permission in manifest<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Write the class below in your package
public class StartupReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
Log.e("MyStrtupIntentReceiver" ,"################# onReceive() system boot");
}
}