The idea is to manage what activity will be launched depending on already set up properties? Now I'm using Activity A1 which decides Activity A2 or Activity A3 will be launched.
A1 extends Activity{
...
onCreate(...) {
Intent intent = new Intent();
if (launchA2){
intent = new Intent(this,A2.class);
} else {
intent = new Intent(this,A3.class);
}
startActivity(intent);
finish();
}
...
}
Is there any solution to move this logic into Application class or somewhere without A1 class? Futhermore, there is another problem about AndroidManifest.xml file.
<activity
android:name="A1"
android:launchMode="singleTop"
android:label="@string/app_alias">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Is it possible to change this Activity programmatically?