您想将“ 强” bmr < / 强” 到“ 强” 缩略语 < 强” 按钮按钮上的“ 强” 活性 < /强” 。 在按键上使用以下代码传送数据 :
Intent n = new Intent(this, MainActivity.class);
Bundle bundle = new Bundle();
bundle.putString(“myValue“,""+bmr);
n.putExtras(bundle);
startActivity(n);
在您的“ 坚固” 主活动 < / 坚固” 从包中获取您的数据 :
Bundle bundle = getIntent().getExtras();
String retbmr = bundle.getString(“myValue”);
如果需要,则将整数分析为整数 :
int nbmr = Integer.parseInt(retbmr);
或直接表示:
int nbmr = Integer.parseInt(bundle.getString(“myValue”));