title: Start Activity Intent from Android Application
body: <p>I have an activity that holds a handler that I need to be running for the whole app. What I need to do is call the handler activity whenever main activity starts up, then upon executing a function at handler activity, handler activity should start the intent into second activity.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public class MyApp extends Application {
  
      public void onCreate() {
          h = new Handler() {
      @Override
      public void handleMessage(Message msg) {
          Bundle b = msg.getData();
                  Log.d("tag",b.getString("msg"));
  
                  //THIS IS WHERE I WANT TO OPEN SECONDACTIVITY
          }
       };
     }
  }
  </code></pre>
  
  <p>MyApp is a global Application class I use to run a socket connection across the whole app. It needs to be alive as long as the app is running.</p>