title: BroadCast Receiver not launching activity
body: <p>I am implemeting a hidden app. I wantt to hide the app in the phone and launch it when I call a certain number.</p>
  
  <p>In first place I have an alias-activity declared on the manifest, and I hide it. It is MainActivity2:</p>
  
  <pre><code>public class Main2Activity extends AppCompatActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main2);
  
      PackageManager p = getPackageManager();
      ComponentName LAUNCHER_COMPONENT_NAME = new ComponentName(
              "com.example.susan.oculta.launcher", "com.example.susan.oculta.launcher.Launcher");
      p.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);...
  </code></pre>
  
  <p>Some Manifest lines:</p>
  
  <pre><code>&lt;activity-alias
          android:name=".launcher.Launcher"
          android:targetActivity=".launcher.Main2Activity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity-alias&gt;
  </code></pre>
  
  <p>With this code I am able to hide the icon.</p>
  
  <p>I also have a BroadCast Receiver. This one:</p>
  
  <pre><code>public class LaunchAppViaDialReceiver extends BroadcastReceiver {
  @Override
  public void onReceive(Context context, Intent intent) {
      Bundle bundle = intent.getExtras();
      if (null == bundle)
          return;
      String phoneNubmer = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
      //here change the number to your desired number
      if (phoneNubmer.equals("12345")) {
          Log.i("reciving", "receeeeeeeeeiving");
  
          Intent i = new Intent();
          i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
          i.setClass(context, MainActivity.class);
          context.startActivity(i);
  
          setResultData(null);
          Toast.makeText(context, "aaaa", Toast.LENGTH_LONG).show();
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem is that when I dial "12345" the Toast shows up, but MainActivity does not. I have tried adding flags to the intent and starting the intent finding it by package. But the intent seems to not be working.
  The log "receeeeeeeeeiving" also shows up.</p>