Till Android 6.0 whenever I Kill my app my service gets restarted automatically, but when I tested it in 7.1.1 my service does not gets restart it stops.
I tried restarting the service in activity onDestroy like this,
@Override
protected void onDestroy() {
super.onDestroy();
Util.printMessage("onDestroy.....");
Intent locationIntent = new Intent(getApplicationContext(), SupportService.class);
startService(locationIntent);
Util.printMessage("running...?..." + isMyServiceRunning(SupportService.class));
}
But this solution did not work, can anyone suggest what is the issue or how to start the service again and same for the boot change receiver my broadcast does not get call when device is rebooted.