Code example for FragmentActivity

Methods: finish, getApplicationContext, startActivity

0
		displaySplashScreen(); 
		//setContentView(R.layout.main); 
	} 
	 
	void displayMainActivity(){ 
		Intent intent = new Intent(this.getApplicationContext(), TWLoginActivity.class);
		startActivity(intent);
		this.finish();
	} 
	 
    private void displaySplashScreen(){ 
    	final TWSplashScreenFragment frag = TWSplashScreenFragment.newInstance();
    	frag.show(this.getSupportFragmentManager(), "SPLASH_SCREEN");
    	final Handler handler = new Handler();
    	handler.postDelayed(new Runnable(){
    		public void run(){ 
    			frag.dismiss();
    			displayMainActivity(); 
    		} 
    	}, 1000); 
    }