Android 页面跳转 传递参数
2014-05-06 17:35
393 查看
第一个页面跳转 传递值
Button bn1=(Button)findViewById(R.id.btn_Login); //跳转
bn1.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent=new Intent(tiaoz.this,nexts.class);
//传值
EditText txt_username=(EditText)findViewById(R.id.edit_username);
EditText txt_password=(EditText)findViewById(R.id.edit_password);
Bundle bundle = new Bundle();
bundle.putString("key_username", txt_username.getText().toString());
bundle.putString("key_password", txt_password.getText().toString());
intent.putExtras(bundle);
startActivity(intent);
finish();
}
});
第二个页面接收值
Bundle bunde = this.getIntent().getExtras();
String strs="用户名:"+bunde.getString("key_username").toString()+"密码:"+bunde.getString("key_password").toString();
//改变文本框的文本内容
show.setText(strs);
Button bn1=(Button)findViewById(R.id.btn_Login); //跳转
bn1.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent=new Intent(tiaoz.this,nexts.class);
//传值
EditText txt_username=(EditText)findViewById(R.id.edit_username);
EditText txt_password=(EditText)findViewById(R.id.edit_password);
Bundle bundle = new Bundle();
bundle.putString("key_username", txt_username.getText().toString());
bundle.putString("key_password", txt_password.getText().toString());
intent.putExtras(bundle);
startActivity(intent);
finish();
}
});
第二个页面接收值
Bundle bunde = this.getIntent().getExtras();
String strs="用户名:"+bunde.getString("key_username").toString()+"密码:"+bunde.getString("key_password").toString();
//改变文本框的文本内容
show.setText(strs);
相关文章推荐
- Android,使用Intent或Bundle传递参数,跳转页面。
- 如何实现android跳转页面并传递参数
- Android Activity中使用Intent实现页面跳转与参数传递的方法
- Android 实现页面跳转并传递参数教程
- Android 页面跳转传递参数及页面返回接收参数
- Android 实现页面跳转并传递参数
- Android Studio第三十八期 - HIOS跳转协议解决URI跳转原生页面并传递参数
- Android实现页面跳转及传递参数的方法
- Android,使用Intent或Bundle传递参数,跳转页面。
- Android页面跳转是如何传递参数的
- Android,使用Intent或Bundle传递参数,跳转页面
- Android 之不同Activity间页面的跳转与传递参数
- Android,使用Intent或Bundle传递参数,跳转页面。
- Android 实现页面跳转并传递参数教程
- Android 实现页面跳转并传递参数
- Android+Jquery Mobile学习系列(4)-页面跳转及参数传递
- Android,使用Intent或Bundle传递参数,跳转页面
- Android 通过URL scheme 实现点击浏览器中的URL链接,启动特定的App,并调转页面传递参数
- PHP跳转到另一个画面,并且带着该行内的一个数值作为参数传递给下一个页面.能给例子吗
- Android视频学习(五):页面跳转和数据传递