Prevent activity from being destroyed from service
<p>I'm using the following code to load an activity in a view:</p>

<pre><code>LocalActivityManager mgr = getLocalActivityManager();

Intent i = new Intent(this, SomeActivity.class);

Window w = mgr.startActivity("unique_per_activity_string", i);
View wd = w != null ? w.getDecorView() : null;
</code></pre>

<p>Which seems to work perfectly. The only problem is that the activity which was loaded gets destroyed, so i cannot work with the activity.</p>

<blockquote>
  <p>** Activity (main) Create, isFirst = true **</p>
  
  <p>** Activity (main) Resume **</p>
  
  <p>** Activity (main) Pause, UserClosed = false **</p>
  
  <p>** Activity (main) Resume **</p>
  
  <p>** Service (windowservice) Create **</p>
  
  <p>BroadcastReceiver has been initialized.</p>
  
  <p>** Service (windowservice) Start **
  ** Activity (rammonitor) Create, isFirst = true **</p>
  
  <p>** Activity (rammonitor) Resume **</p>
  
  <p>** Activity (main) Pause, UserClosed = true **</p>
  
  <p>** Activity (rammonitor) Pause, UserClosed = true **</p>
</blockquote>

<p>The activity gets called from a Service.</p>

<p>Is there a way I can prevent my activity of getting destroyed, or just to keep it focused when it's created?</p>
