星空网 > 软件开发 > 操作系统

Android activity之间传值关键性代码

从当前activity中获取et 表单中的值,并跳转到myactivity.java所绑定的

private EditText et;

Intent intent=new Intent(MainActivity.this,myactivity.class);
String str=et.getText().toString();
intent.putExtra("name", str);
startActivity(intent);

myactivity.java所绑定的

private TextView tv=(TextView) findViewById(R.id.tv);
String str=getIntent().getStringExtra("name");
tv.setText(str);




原标题:Android activity之间传值关键性代码

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Cdiscount French Day 促销:https://www.goluckyvip.com/tag/16932.html
Cdiscount店铺:https://www.goluckyvip.com/tag/16933.html
Cdiscount店铺申请:https://www.goluckyvip.com/tag/16934.html
Cdiscount开店:https://www.goluckyvip.com/tag/16935.html
Cdiscount开店费用:https://www.goluckyvip.com/tag/16936.html
Cdiscount开店流程:https://www.goluckyvip.com/tag/16937.html
字节跳动辟谣!TikTok收紧美国开店政策为不实信息:https://www.goluckyvip.com/news/188212.html
2024北京庞各庄镇梨花节开幕时间是几号?:https://www.vstour.cn/a/365179.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流