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:
1 I have a fairly decent handle on how to switch between activities (based on this article: http://www.linux-mag.com/id/7498) but I'm not sure how to go about creating a new one (with eclipse).
2 Once I have a new activity created, how can I set it as the default activity of my application? I presume I could just change the name of the classes...but is there a more elegant way to handle that (maybe within the
AndroidManifest.xml
)?
You add this you want to launch activity
android:exported="true"
in manifest file likeOpen java file of this activity and right click then click on Run 'main Activity'
Oprn java file of this acivity and press Ctrl+Shift+F10
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.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
3:) Now copy the below code in between activity tags same as:
and also check that newly added lines are not attached with other activity tags.
Just go to your AndroidManifest.xml file and add like below
then save and run your android project.
It's simple. Do this, in your
Manifest
file.