title: How to automatically bring an application in background to the foreground on wake up?
body: <p>I'm developing an app for personal use. I want the app to automatically open when I unlock my phone. I've seen posts talking about notification use instead but I was wondering if it was still possible. I really don't care about the conflicts occurring.</p>
  <pre><code>public static class Receiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          if (intent != null &amp;&amp; intent.getAction() != null) {
              if (intent.getAction().equals(Intent.ACTION_USER_PRESENT)) {
  
                  if (dev) {
                      //open ScreenActivity
                      // some code ....
                  }
              }
          }
      }
  }
  </code></pre>
  <p>I have a working receiver for <code>ACTION_USER_PRESENT</code> but I miss the commands to bring the app to the foreground. I can also create a 2nd app and have this one open it but i can't find a proper way to do it. Any suggestions?</p>