Here is the scenario:
AndroidManifest.xml defines a single Activity with android:launchMode=\"singleTask\". (This means there should be a single activit
In MyMainActivity definition (AndroidManifest.xml):
Programmatically bringing application to foreground:
Intent it = new Intent("intent.my.action");
it.setComponent(new ComponentName(context.getPackageName(), MyMainActivity.class.getName()));
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.getApplicationContext().startActivity(it);
Note: context.startActivity(it) would NOT work when the context object is same as the activity one wants to bring up.