Answer the question
In order to leave comments, you need to log in
Java. How to use number spans?
I do tests on the subject of the application itself in my android application. I'll just give an example. I implement it with such an uncomplicated code (the radioButton buttons are declared, I just don’t include the extra here):
int balls1answer;
int balls2answer;
String resultText;
if (mRadioButton1_1.isChecked()) balls1answer = 1;
if (mRadioButton1_2.isChecked()) balls1answer = 2;
if (mRadioButton1_3.isChecked()) balls1answer = 3;
if (mRadioButton2_1.isChecked()) balls2answer = 1;
if (mRadioButton2_2.isChecked()) balls2answer = 2;
if (mRadioButton2_3.isChecked()) balls2answer = 3;
int resultBalls = balls1answer + balls2answer;
/* Далее идет подсчет и передача результата во вторую активность в зависимости от набранных баллов за ответы */
if (resultBalls == 2 || resultBalls == 3) resultText = "Результат 1";
if (resultBalls == 4 || resultBalls == 5) resultText = "Результат 2";
if (resultBalls == 6) resultText = "Результат 3" ;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question