automatically start up a service when the application is closed
<p>i have created an application which will start a service to check a particular remote file for update..</p>

<p>the service part is done but now the user needs to manually start up the service</p>

<p>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)</p>

<p><strong>++++++++++ANSWER++++++++++</strong></p>

<p>anyway figured out how to do it already</p>

<pre><code>    @Override
protected void onPause() 
{
    startService(new Intent(this, fileService.class));
    super.onPause();
}

@Override
protected void onResume() 
{
    stopService(new Intent(this, fileService.class));
    super.onResume();
}
</code></pre>

<p>i used this to start the service when the application is paused and stop when its resume</p>
