Restore application when receiving broadcast
<p>I have an application A that has a broadcast receiver. 
This receiver listens to certain broadcasts I get from another application B.</p>

<p>Now when I receive a certain broadcast from application B I want to open my application A.<br>
At the moment I have the following code in my broadcast receiver in application A:</p>

<pre><code>    @Override
    public void onReceive(Context context, Intent intent) {
     if(intent.getAction().equals("startApplication"))
        {
            Intent LaunchIntent = mContext.getPackageManager().getLaunchIntentForPackage("packageName application A");
            context.startActivity(LaunchIntent);
        }
    }
</code></pre>

<p>But this code always starts the main activity of application A.<br>
When my application is already open in the background I want to restore the application rather than starting from the main activity.   </p>

<p>Like when you press home in an application and return to it with recent apps.</p>

<p>Thanks!</p>
