我正在尝试显示我设置的文本TextView
。我已经分配了一个strings.xml
名为operator_mixed的字符串
字符串.xml
<string name="operator_mixed">%d %s %d %s %d</string>
在我的 initialize.java 文件中,我尝试引用此字符串,但它不显示任何内容。但是,当我尝试显示没有任何格式的文本时,它有点工作,但我知道在 textview 中连接字符串并不可取。
初始化.java
textview.setText(getString(R.string.operator_mixed, a1, operator1, a2, operator2, a3));
其中 a1, a2, a3 是整数,operator1, operator2 是字符串。
我的代码有问题吗?