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();
版权声明:本文为wangyw原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。