Вам просто нужно будет использовать оператор равенства ==
вместо оператора присваивания =
.Это будет оценивать ваше выражение как логическое значение по желанию:
public void Gotonextpage() {
while (PageNo == 1){
Act2PageNo.setText("Text will be put here to describe Option 1");
}
while (PageNo == 2){
Act2PageNo.setText("Text will be put here to describe Option 2");
}
while (PageNo == 3){
Act2PageNo.setText("Text will be put here to describe Option 3");
}
}
Как говорится, я думаю, что вам нужно выражение if
, так как блок while
будет зацикливаться до тех пор, пока условие не станет ложным,и в данном конкретном случае - цикл навсегда.Итак:
public void Gotonextpage() {
if (PageNo == 1) {
Act2PageNo.setText("Text will be put here to describe Option 1");
}
if (PageNo == 2) {
Act2PageNo.setText("Text will be put here to describe Option 2");
}
if (PageNo == 3) {
Act2PageNo.setText("Text will be put here to describe Option 3");
}
}