Activity间用Intent和Bundle传递参数
来源:互联网 发布:淘宝店铺地址怎么改 编辑:程序博客网 时间:2024/06/07 15:09
传递方:
//点击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传递集合/对象
- iOS压缩与解压框架SSZipArchive使用详解
- ScrollView与TableView实现选择效果
- 《JAVA与模式》之装饰模式
- Android Support v4、v7、v13的区别和应用场景
- Android获取Manifest中<meta-data>元素的值
- Activity间用Intent和Bundle传递参数
- java程序设计基础_陈国君版第五版_第四章例题
- JAVA timer.schedule用法
- 常量指针和指针常量的区别详解
- (java)Subsets II
- AsyncTask的实现
- java反射之获取Class对象
- lightOJ 1186 Incredible Chess
- Masonry简单使用