i have created an application which will start a service to check a particular remote file for update..
the service part is done but now the user needs to manually start up the service
is there a way which i can make the service start up automatically once the application is not in view (either the user clicks the home button/clicks back or open another application)
++++++++++ANSWER++++++++++
anyway figured out how to do it already
@Override
protected void onPause()
{
startService(new Intent(this, fileService.class));
super.onPause();
}
@Override
protected void onResume()
{
stopService(new Intent(this, fileService.class));
super.onResume();
}
i used this to start the service when the application is paused and stop when its resume