我正在将值从Activity Ato传递Activity B。它工作正常。
例如,如果我传递 String "Harvey Brown",那么在下一个活动中它也会显示"Harvey Brown".
但我还想"Author: "在之前添加文本"Harvey Brown"并显示总和结果TextView,现在而不是仅 "Harvey Brown".
它会显示
Author:Harvey Brown
对于每个意图。
这是代码,我用来传递字符串值:
intent.putExtra("Title",mData.get(position).getTitle());
在接下来的活动中,我收到了价值
Intent intent = getIntent();
String author_name = intent.getExtras().getString("author_name");
我相应地将值设置为
author_name = (TextView) findViewById(R.id.author_nameid);
author_name.setText(author_name);
森林海
相关分类