title: Android Intent to start Main activity of application
body: <p>I am trying to start the main activity from inside a BroadcastReceiver.
  I dont want to supply the activity class name but to use the action and category for android to figure out the main activity.</p>
  
  <p>It doesnt seem to work.</p>
  
  <p>Sending Code:</p>
  
  <pre><code>Intent startIntent = new Intent();
  
  startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  startIntent.setAction(Intent.ACTION_MAIN);
  startIntent.setPackage(context.getPackageName());
  startIntent.addCategory(Intent.CATEGORY_LAUNCHER);        
  context.startActivity(startIntent);
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Caused bt: android.content.ActivityNotFoundException: No Activity found to handle Intent {
    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
    flg=0x10000000 pkg=com.xyz.abc (has extras) }</p>
  </blockquote>
  
  <p>Any ideas?</p>