How to start/stop a service in Android?

devquora
devquora

Posted On: Dec 26, 2020

 

You can Start android background service as follows:

Intent intent = new Intent(Activity.this, MyBackgroundService.class);
startService(intent);
You can Stop android background service as follows:
Intent intent = new Intent(Activity.this, MyBackgroundService.class);
stopService(intent);


    Related Questions

    Please Login or Register to leave a response.

    Related Questions