i have a receiver that starts a service at boot but the receiver never gets fired when at boot
manifest
<service android:enabled="true" android:name=".BatteryService"></service>
<reciever android:name=".BatteryReciever">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</reciever>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
why does it not work, everything looks correct
if i open my app the service starts fine
Receiver class
public class BatteryReciever extends BroadcastReceiver {
@Override
public void onReceive(Context arg0, Intent arg1) {
arg0.startService(new Intent(arg0, BatteryService.class));
}//end onRecieve
}
tyzyj,
It looks like you may have misspelled the word
receive
in multiple places asrecieve
.Try...
unless the class name is misspelled as well? You may want to post the code for that Receiver class.