android - 单击第一个和第二个活动的文本,应该对第三个活动可见
问题描述
我正在尝试找到最好的方式来显示我们在第三个活动中单击了第一个和第二个活动的 textview。
就像我有三个活动 AccountFrom、AccountTo 和 transferDetails。我想知道用户点击了什么帐户类型,以便我可以在第三个活动中显示。
解决方案
1. on AccountFrom Activity
Intent intent = new Intent(AccountFrom.this, AccountTo.class);
**intent.putExtra("accounttype","accountTypeVariable");**
startActivity(intent);
2. Receive intent on AccountTo Activity
Intent intent = getIntent();
if (intent != null)
{
String accountTypeValue = intent.getStringExtra("accounttype")
}
推荐阅读
- docker - Docker-compose:OCI 运行时创建失败,entrypoint.sh 没有这样的文件或目录
- java - 下载 Android TTS 音频
- c++ - c++ 中的异常处理(在 if 语句中)
- php - 如果网站在 Google 搜索结果中列出,则防止包含 PHP 文件
- angular - 正则表达式匹配 Angular 代理中的各种 URL
- jmeter-plugins - 在 JMeter 中,为什么加载时间等于延迟?
- apache - Apache .htacess 重定向
- google-sheets - QUERY 和 IMPORTRANGE 的问题 | 谷歌表格
- swiftui - 在 Touch Bar 中显示 TabView 元素 - SwiftUI
- microsoft-graph-api - 图 api me/messages 端点不允许在选择列表中开始和结束日期时间