title: Android. Strange activities behaviour. Activities dependency within application
body: <p>I am experiencing a strange behavior. In my application I have activity "A" which runs Service "S". The main responsibility of "S" is to set a new <code>AlarmManager</code> for specific time. There is also receiver "R" to receive an <code>AlarmManager</code> trigger event. The Receiver sends a broadcast message to "S", which will in some cases start a new activity "B" using <code>Intent.FLAG_ACTIVITY_NEW_TASK</code>.</p>
  
  <p>The problem is that if "A" is on or was moved to the background (by using <code>moveTaskToBack()</code>) everything works just fine. However, if activity "A" was destroyed, "B" would never appear on the screen.
  Why is this happening and what is the possible solution? I think using <code>moveTaskBack()</code> is not the best way.</p>
  
  <p>How does "B" depend on the existence of "A"?</p>