从一个活动传输到另一个活动使用意图
问题描述:
我希望能够从一个活动的数据传输到另一个活动。如何才能做到这一点?
I would like to be able to transfer data from one activity to another activity. How can this be done?
答
通过以下code,我们可以发送活动之间的值
Through the below code we can send the values between activities
使用下面的code在父活动
use the below code in parent activity
Intent myintent=new Intent(Info.this, GraphDiag.class).putExtra("<StringName>", value);
startActivity(myintent);
使用下面的code的子活动
use the below code in child activity
String s= getIntent().getStringExtra(<StringName>);