12020-10-04 16:36:04.088 10362-10362/jp.wings.nikkeibp.quizapp E/AndroidRuntime: FATAL EXCEPTION: main
2 Process: jp.wings.nikkeibp.quizapp, PID: 10362
3 java.lang.RuntimeException: Unable to start activity ComponentInfo{jp.wings.nikkeibp.quizapp/jp.wings.nikkeibp.quizapp.businessActivity}: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
4 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
5 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
6 at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
7 at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
8 at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
9 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
10 at android.os.Handler.dispatchMessage(Handler.java:107)
11 at android.os.Looper.loop(Looper.java:214)
12 at android.app.ActivityThread.main(ActivityThread.java:7356)
13 at java.lang.reflect.Method.invoke(Native Method)
14 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
15 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
16 Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
17 at java.util.ArrayList.get(ArrayList.java:437)
18 at jp.wings.nikkeibp.quizapp.businessActivity.showNextQuiz1(businessActivity.java:88)
19 at jp.wings.nikkeibp.quizapp.businessActivity.onCreate(businessActivity.java:66)
20 at android.app.Activity.performCreate(Activity.java:7802)
21 at android.app.Activity.performCreate(Activity.java:7791)
22 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
23 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
24 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
25 at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
26 at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
27 at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
28 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
29 at android.os.Handler.dispatchMessage(Handler.java:107)
30 at android.os.Looper.loop(Looper.java:214)
31 at android.app.ActivityThread.main(ActivityThread.java:7356)
32 at java.lang.reflect.Method.invoke(Native Method)
33 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
34 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
まあ、だいたいそのような解釈でいいと思います。問題数分FEquestion積んだ後にshowNextQuiz1()メソッドを呼び出して、その序盤で
Random random = new Random();
int randNum1 = random.nextInt(FEquestion1.size());
ArrayList<String> quiz1 = FEquestion1.get(randNum1);
という処理で積んだ中からランダムに問題を取り出しているようですね。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/10/04 01:03
2020/10/08 00:54
2020/10/08 08:28 編集
2020/10/09 01:40
2020/10/09 15:05
2020/10/10 00:08
2020/10/10 12:19
2020/10/11 07:57