データベースから3 つのレベルを作成しようとしてexpandable list
います。2番目のレベルまでは少し動作しますが、ある時点で3番目のレベルを選択すると、次のようなエラーが発生します。配列値が原因で見つかったように(ただし、結果の配列には値が含まれる場合があります)。親切に解決策を確認して元に戻してください。
エラー
05-03 12:06:17.990: E/AndroidRuntime(399): Uncaught handler: thread main exiting due to uncaught exception
05-03 12:06:18.010: E/AndroidRuntime(399): java.lang.IndexOutOfBoundsException: Invalid location 0, size is 0
05-03 12:06:18.010: E/AndroidRuntime(399): at java.util.ArrayList.get(ArrayList.java:341)
05-03 12:06:18.010: E/AndroidRuntime(399): at com.example.home.MainActivity$SecondLevelAdapter.getChildView(MainActivity.java:270)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:451)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.AbsListView.obtainView(AbsListView.java:1256)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.makeAndAddView(ListView.java:1668)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.fillDown(ListView.java:637)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.fillSpecific(ListView.java:1224)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.layoutChildren(ListView.java:1499)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.AbsListView.onLayout(AbsListView.java:1113)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.View.layout(View.java:6830)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.setupChild(ListView.java:1755)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.makeAndAddView(ListView.java:1661)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.fillSpecific(ListView.java:1212)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.ListView.layoutChildren(ListView.java:1532)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.AbsListView.onLayout(AbsListView.java:1113)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.View.layout(View.java:6830)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.View.layout(View.java:6830)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.View.layout(View.java:6830)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.View.layout(View.java:6830)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.View.layout(View.java:6830)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.ViewRoot.performTraversals(ViewRoot.java:996)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.os.Handler.dispatchMessage(Handler.java:99)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.os.Looper.loop(Looper.java:123)
05-03 12:06:18.010: E/AndroidRuntime(399): at android.app.ActivityThread.main(ActivityThread.java:4363)
05-03 12:06:18.010: E/AndroidRuntime(399): at java.lang.reflect.Method.invokeNative(Native Method)
05-03 12:06:18.010: E/AndroidRuntime(399): at java.lang.reflect.Method.invoke(Method.java:521)
05-03 12:06:18.010: E/AndroidRuntime(399): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-03 12:06:18.010: E/AndroidRuntime(399): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-03 12:06:18.010: E/AndroidRuntime(399): at dalvik.system.NativeStart.main(Native Method)