Android Service
<p>I want my app to have a service that will run in the background and do some tasks and if needed will start different activities to give the user some UI posibilities.</p>

<p>This is the service onStartCommand:</p>

<pre><code>``//do some stuff
 Intent dialogIntent = new Intent(getBaseContext(), ControlActivity.class);
 dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 getApplication().startActivity(dialogIntent);
 return START_STICKY;
</code></pre>

<p>For some reason the service class becomes null at the control activity and the service stops running.
Why is that?</p>

<p>Thanks,
Nahum</p>
