发送
intent.setClass(Bmi.this, Report.class);
Bundle bundle = new Bundle();
bundle.putString("KEY_HEIGHT", field_height.getText().toString());
bundle.putString("KEY_WEIGHT", field_weight.getText().toString());
intent.putExtras(bundle);
startActivity(intent);
接收解析
Bundle bunde = this.getIntent().getExtras();
double height = Double.parseDouble(bunde.getString("KEY_HEIGHT"))/100;
double weight = Double.parseDouble(bunde.getString("KEY_WEIGHT"));

也可以不透过 Bundle 交换信息
intent.setString发送
this.getIntent().getString接收

相关文章:

  • 2021-10-04
  • 2021-12-07
  • 2021-09-09
  • 2022-01-22
  • 2021-09-27
  • 2022-01-22
  • 2021-09-11
  • 2021-09-29
猜你喜欢
  • 2021-04-02
  • 2022-12-23
  • 2021-08-27
  • 2021-11-28
  • 2022-12-23
  • 2021-11-27
相关资源
相似解决方案