Ok...it is more likely to be my fault ;)
When I do:
public class XmlLifecycleTests extends ActivityUnitTestCase<Main> {
...
(not in setUp)
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setPackage(APP_PACKAGE);
intent.setClassName(APP_PACKAGE, ".gui.Main");
startActivity(intent, null, null);
I get:
java.lang.IllegalArgumentException: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{ar.android.app.gui/ar.android.app.gui.GLarmMain}
at android.support.v4.app.NavUtils.getParentActivityName(NavUtils.java:282)
at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:119)
at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
at ar.android.app.gui.Main.onCreate(Main.java:78)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.test.ActivityUnitTestCase.startActivity(ActivityUnitTestCase.java:158)
Note that my Main activity is defined under .gui while the main package in the manifest is one folder up, this is why I specified everything in the intent. But the thrown error seems to still get the wrong (Package,Class) name pair.