I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen).
Couple questions
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Go to AndroidManifest.xml in the root folder of your project and change the Activity name which you want to execute first.
Example:
<activity android:name=".put your started activity name here"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Follow to below instructions:
1:) Open your AndroidManifest.xml
file.
2:) Go to the activity code which you want to make your main activity like below.
such as i want to make SplashScreen as main activity
<activity
android:name=".SplashScreen"
android:screenOrientation="sensorPortrait"
android:label="City Retails">
</activity>
3:) Now copy the below code in between activity tags same as:
<activity
android:name=".SplashScreen"
android:screenOrientation="sensorPortrait"
android:label="City Retails">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and also check that newly added lines are not attached with other activity tags.
If you are using Android Studio and you might have previously selected another Activity to launch.
Click on Run > Edit configuration
and then make sure that Launch default Activity is selected.
You add this you want to launch activity
android:exported="true"
in manifest file like
<activity
android:name=".activities.activity.MainActivity"
android:windowSoftInputMode="adjustPan"
android:exported="true"/>
<activity
Open java file of this activity and right click then click on Run 'main Activity'
Open java file of this activity and press Ctrl+Shift+F10.