当我写一篇新博文时,我需要一个WP插件来更新我的谷歌+.我想要一些自动的东西,不需要+1博客文章.
我正在开发一个小测验应用程序。正确的答案存储在字符串数组中,因此当用户选择其中一个选项(每个选项的单选按钮)时,我会进行字符串比较。
如果答案是错误的,则应该对其他单选按钮进行迭代,以验证哪个单选按钮与我的答案数组具有相同的字符串,以标记这是正确的答案。
correctAnswer = answers[position];
int currentAnswerId = optionsRadioGroup.getCheckedRadioButtonId();
RadioButton selectedAnswer = (RadioButton) findViewById(currentAnswerId);
if(selectedAnswer.getText().equals(correctAnswer)) {
selectedAnswer.setTextColor(Color.GREEN);
}
else {
selectedAnswer.setTextColor(Color.RED);
//search the other radioButtons for the matching string
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激,我猜这并不难,但我是 Android 和 Java 开发新手。