I am working on an android app. I want to change Start activity dynamically. i mean when user start app first time then start activity will different and when start second time start activity change.This will skip first two activity and move to third activity .how can i achieve this.
Yes it is. If your requirement are like that then there is no harm in doing that.
The startActivity() method starts an instance of the DisplayMessageActivity that's specified by the Intent . Next, you need to create that class.
You cannot change the first activity dynamically, but you can create a transparent activity like this:
<activity
android:name=".ActivityLauncher"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and select next activity in the onCreate
method:
if ( logged() ) {
intent = new Intent(this,MainActivity.class);
} else {
intent = new Intent(this,SignInActivity.class);
}
startActivity(intent);
finish();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With