i have following problem:
i write broadcastReceiver that receive android.intent.action.BOOT_COMPLETED all work fine if i do restart from power options or remove battery, but if i use POWER OFF - power option system did't go thrue BOOT_COMPLETED intent. Please help what kind of intent i must receive to get this to cases for auto startup activity on android phone.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<receiver android:name=".StartupBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" 开发者_C百科/>
</intent-filter>
</receiver>
In your Broadcast Receiver class, Check :
getIntent().getAction().equalsIgnoreCase("android.intent.action.BOOT_COMPLETED") { // call startActivity(intent); }
It will definitely help you.
精彩评论