Android界面跳转几种情况

    Android界面简单跳转,

         Intent intent =new Intent(MainActivity.this,SecondActivity.class);
           startActivity(intent);

  带参数跳转

	Intent intent=new Intent();
	intent.setClass(MainActivity.this, SecondActivity.class);
			Bundle bundleSimple = new Bundle();  
			bundleSimple.putLong("180", Height);  
			bundleSimple.putLong("22", age);  
			bundleSimple.putString("sdad", name);
	intent.putExtras(bundleSimple); 
	setting.this.startActivity(intent);

  跳转并销毁前面页

Intent intent=new Intent();
intent.setClass(SecondActivity.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();

 

posted @ 2018-12-25 10:35  David~Wang  阅读(626)  评论(0编辑  收藏  举报