The code to start the service at bootup..... I have even included the permissions in the manifest file as mentioned before...but the service doesn't start...i have to explicitly start as of now by startService(Intent..) commmand... Is there any mistake in what i have done??
public class BootReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent arg1) {
Intent serviceIntent = new Intent(BackgroundService.class.getName());
context.startService(serviceIntent);
}
}
<receiver android:name="BootReceiver">
<intent-filter>
<action
android:name="android.intent.action.BOOT_COMPLETED">
</action>
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />