【发布时间】:2020-12-12 10:35:20
【问题描述】:
当我编写代码以在文本视图中获取数据时,我正在尝试将数据从 一个活动 传递到 另一个活动然后向 textView 显示错误 谁能告诉我如何解决此错误。我在这里粘贴我的代码请检查并告诉我。 在第 12、14 和 16 行出错。 在开始 "textView"
错误编译器显示为:
错误:找不到符号 textView.setText(NameRecive);
符号:可变文本视图
位置:barcode_genrator 类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_barcode_genrator);
Intent intent = getIntent();
String NameRecive = intent.getStringExtra(activity_DataEntry.NAME_TO_SEND);
String SurnameRecive = intent.getStringExtra(activity_DataEntry.SURNAME_TO_SEND);
String NumberRecive = intent.getStringExtra(activity_DataEntry.NUMBER_TO_SEND);
TextView name = findViewById(R.id.FN);
textView.setText(NameRecive);
TextView surname = findViewById(R.id.LN);
textView.setText(SurnameRecive);
TextView number = findViewById(R.id.MN);
textView.setText(NumberRecive);
}
【问题讨论】:
标签: java android android-studio compiler-errors textview