I have override onTaskRemoved in my Service but it never get called when I kill app in device Xiaomi but in SamSung, Sony it get called normally
( I don't set ServiceInfo.FLAG_STOP_WITH_TASK for my Service)
public class MyService extends Service {
@Override
public void onTaskRemoved(Intent rootIntent) {
super.onTaskRemoved(rootIntent);
Toast.makeText(this,"onTaskRemoved",Toast.LENGTH_SHORT).show();
Log.i("TAG", "Task removed");
}
}
I need detect when service stop to start service again because START_STICKY not working like my question here
How can I handle this case. Any help or suggestion would be great appreciated?