Launch activity from service when foreground activity has CLOSE_SYSTEM_DIALOGS
<p>I'm doing a service able to launch packages and activities from commands sent remotely (no, it's not a virus, it's just for business purposes where my company needs to remotely control devices they have). Based on those commands, I'm able to start activities by using:</p>

<pre><code>context.startActivity(new Intent(context, Activity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
</code></pre>

<p>However, is the foreground activity has CLOSE_SYSTEM_DIALOGS as action (I think this is the cause), the activity that I want to start is not started. I don't see any message log...</p>

<p>As I have the device rooted, I've also tried to do a "su -c am start -n &lt;myActivity> but this does not work too.</p>

<p>Any idea?</p>