-2
我有以下内容。从我的strings.xml中的strings.xml中选择不同的值
<string name="alphabet">ABCDEFGHIJKLMNOPQRSTUVWXYZ</string>
<string name="alphabet_numbers">123456789</string>
和我得到的字母的数值与我的代码波纹管: 串字母= getResources()的getString(R.string.alphabet)。
我需要用if语句来获得alphabet_number,但它不工作
String mychoice = "yes";
if (mychoice.equals(mychoice)){
String alphabet = getResources().getString(R.string.alphabet);
}else{
String alphabet = getResources().getString(R.string.alphabet_numbers);
}
它不返回字符串字母。我需要获取字符串字符串以将其用于我的MainActivity类,
'我需要获取alphabet_number和if语句但它不工作'和'它不返回字符串字母表之间存在矛盾。 '你能解释一下你的要求是什么吗? –