Activity间用Intent和Bundle传递参数
来源:互联网 发布:炉石传说淘宝60包 编辑:程序博客网 时间:2024/06/05 10:31
传递方:
//点击btn_sub传递 fieldHeight.getText()和 fieldWeight.getText()
private void setListeners()
{
btn_sub.setOnClickListener(calrBMI);
}
private OnClickListener calrBMI = new OnClickListener()
{
public void onClick(View v)
{
Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putString("key_height", fieldHeight.getText().toString());
bundle.putString("key_weight", fieldWeight.getText().toString());
intent.setClass(ActivityMain.this,Report.class);
intent.putExtras(bundle);
startActivity(intent);
}
};
接收方:
Bundle bundle = new Bundle();
bundle = this.getIntent().getExtras();
double height = Double.parseDouble(bundle.getString("key_height"))/100;
double weight = Double.parseDouble(bundle.getString("key_weight"));
- Activity间用Intent和Bundle传递参数
- Activity间用Intent和Bundle传递参数
- Activity间用Intent和Bundle传递参数
- Activity间用Intent和Bundle传递参数
- Activity和Fragment用Intent和Bundle传递参数--总结
- android Activity之间通过Bundle和Intent传递数据
- Activity通过Intent传递对象和参数
- Activity 参数传递 Intent
- singleTask 跳转Activity Bundle和intent参数值为null
- Intent和Bundle传递数据
- Activity中Intent传递数据--Bundle
- 广播或者activity跳转singleTask模式的 Activity Bundle和intent参数值为null
- 通过intent和bundle来进行Activity和Fragment的数据传递
- 在 Activity 之间传递(Bundle)参数
- Android中Activity之间的数据传递(Intent和Bundle)
- 使用Intent和Bundle的数据传递
- android中传递复杂参数,activity之间和fragment之间的bundle传递集合/对象
- android中传递复杂参数,activity之间和fragment之间的bundle传递集合/对象
- linux动态链接库的使用
- MTK 手机开发小技巧
- sqlServer常用命令
- 在地图上画矩形Ajax查询
- AutoHotKey + Longman Dictionary of Contemparory English
- Activity间用Intent和Bundle传递参数
- eclipse 插件开发——运行插件报错 java.lang.NoClassDefFoundError的解决办法
- 关于找工作的标准
- 深入理解Linux的系统调用
- FLEX 定义组件样式的方法总结
- MySQL安装图解[组图]
- 用netstat -ano查看本机端口详解
- Spring security和jasypt共用
- WCF扩展:行为扩展Behavior Extension