I want to start service when I exit from my app.
code is :
Intent i_service = new Intent(MainActivity.this,check.class);
startService(i_service);
And when I re-open my app , I want to stop my service which I started when I exit from my app.
code is:
Intent i_service = new Intent(MainActivity.this,check.class);
stopService(i_service);
This is the right way to do it ?
How can stop my old service?
thanks in advance