发送
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-12-22
  • 2021-10-16
  • 2021-08-01
  • 2021-11-29
  • 2021-08-01
  • 2021-08-03
  • 2021-10-12
  • 2021-11-29
猜你喜欢
  • 2021-11-27
  • 2021-12-07
  • 2021-08-01
  • 2021-08-01
  • 2021-11-04
  • 2021-08-01
  • 2021-10-05
  • 2021-06-26
相关资源
相似解决方案