title: how to start activity when the main activity is running in background?
body: <p>I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).</p>
  
  <p>I tried to enabled it the following way:</p>
  
  <pre><code>@Override
  public void onProductsResponse(List&lt;Product&gt; products) {
      this.products = products;
      moboolo.setProducts(products);
      if(moboolo.getAutomaticNotificationsMode() != 0 &amp;&amp; products.size() &gt; 0){
          if(isRunningInBackground)
          {
              Intent intent = new Intent(this, ProductListActivity.class);
              intent.setAction(Intent.ACTION_MAIN);
              startActivity(intent);
          }
      }
      drawProducts(products);
  
  }
  </code></pre>
  
  <p>this is the method from main activity. When onPause() is executed isRunningInBackground is set true.
  When I tried to debug it when the main application was running in the background the line </p>
  
  <p>startActivity(intent) had no effect (the activity didn't appear).</p>
  
  <p>Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?</p>
  
  <p>Thank you.</p>