Tell me an easy way to do it while opening the application with the name and then the regular activity
Asked
Active
Viewed 43 times
-1
-
Not sure what you want to achieve, can you be more specific? – ohw Jan 22 '16 at 22:06
-
What did you try already ? – Jan 22 '16 at 23:25
-
I haven't tried please tell me in a stepwise manner – Vinith Jan 23 '16 at 02:41
-
I have buttons in my first activity, help me in such a way that when I click on that button I proceed to next activity – Vinith Jan 23 '16 at 05:58
1 Answers
0
By doing this you can start one activity from another:
Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
myIntent.putExtra("key", value); //Optional parameters
CurrentActivity.this.startActivity(myIntent);
EDIT:
if you need a splash screen, here is a solution for it:
How do I make a splash screen?
/** Duration of wait **/
private final int SPLASH_DISPLAY_LENGTH = 1000;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.splashscreen);
/* New Handler to start the Menu-Activity
* and close this Splash-Screen after some seconds.*/
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
/* Create an Intent that will start the Menu-Activity. */
Intent mainIntent = new Intent(Splash.this,Menu.class);
Splash.this.startActivity(mainIntent);
Splash.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
Community
- 1
- 1
ΦXocę 웃 Пepeúpa ツ
- 47,427
- 17
- 69
- 97
-
-
-
Can u now please help to add an activity at the starting of my application that should go on for few seconds and should switch on to some other activity without the user clicking on any button – Vinith Jan 23 '16 at 12:11
-
-
1Exactly I have already designed two activities for my app and now I want to design a splash screen using eclipse – Vinith Jan 23 '16 at 12:18
-
-
Totally in my application I m going to have 4 activities and 3 of them are designed and are being connected now I think I need to add 2nd activity by creating a login page – Vinith Jan 24 '16 at 01:53