How to specify the sequence of activities to be initiated?

Asked

Viewed 53 times

2

Hello. I have a question. I have an APP in which 8 Activities, among them has a Splash Screen Activity that presents my logo and then enters my APP.

The Splash Screen is set as default, but I need to set another Activity as a password to start after the screen that has the logo, because it is starting another Activity that is not the App’s home screen. How could I perform this procedure?

Follow my Androidmanifes.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity" />
        <activity android:name=".Main"/>
        <activity android:name=".ContraDenuncia" />
        <activity android:name=".FavorDenuncia" />
        <activity android:name=".Investigados" />
        <activity android:name=".Objetivo" />
        <activity android:name=".SplashScreenActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>/>
        </activity>

    </application>

</manifest>

I need Activity Main to run after Splashscreenactivity.

Thank you very much.

1 answer

1


You will have to make your other Activity be startled after the execution of your splash. But before that, put the <activity android:name=".SplashScreenActivity"> as first in the manifest. After that go in your splash code, and after you finish running the splash, put this

    Intent it = new Intent(this, MainActivity.class);
    startActivity(it);

In the definition of the intenent, you are specifying let’s say, "where to where" and the startActivity() method is to start the activity defined in Intent

  • 1

    Thank you so much! .

  • Good, we need some =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.