Intent用法
Intent用法实例
1.无参数Activity跳转
Intent it = new Intent(动作页面, 跳转页面);
startActivity(it);
2.向下一个Activity传递数据(使用Bundle和Intent.putExtras)
Intent it = new Intent(Activity.Main.this, Activity2.class);
Bundle bundle=new Bundle();
bundle.putString(key, value); //key作为传递的参数
it.putExtras(bundle);
startActivity(it);
对于数据的获取可以采用:
Bundle bundle=getIntent().getExtras();
String name=bundle.getString(value); //接收的值也是上面的key