2016-01-22 66 views

回答

0

通過這樣做,你就可以開始從另外一個活動:

Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class); 
myIntent.putExtra("key", value); //Optional parameters 
CurrentActivity.this.startActivity(myIntent); 

編輯:如果你需要一個啓動畫面

,這裏是它的一個解決方案:

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); 
} 
+0

謝謝@ jipr311 – Vinith

+0

您是否嘗試過?你在找什麼? –

+0

是的,我試過了,我成功 – Vinith

相關問題