首页 > 解决方案 > 在活动android中重新启动一个void

问题描述

我正在做一个有 x 个问题的测验应用程序。我尝试在 while 和 for 循环中调用该方法来开始一个新问题:

x=10

while(x>=0){
   // void to create question & check;
   x-- ;
}

并使用 for 循环:

for (int x=10; x>0;x --){ 
 //void to to create question & check;

}

但 x 总是返回 0。

如何在不重新启动整个活动的情况下在测验中创建新问题?

标签: javaandroidfor-loopwhile-loop

解决方案


推荐阅读