我更新了我的应用并突然收到此错误。因为我的代码中没有任何行,所以我无法制作它的头部或尾部。
人们已经在我在一台模拟器上看过的手机上看过这个,但在我的家用机器上它运行正常。删除数据库并重新开始,但仍然没有
任何想法都会受到欢迎 感谢
java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:390)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
at android.widget.Spinner.makeAndAddView(Spinner.java:398)
at android.widget.Spinner.layout(Spinner.java:349)
at android.widget.Spinner.onLayout(Spinner.java:313)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
at android.view.View.layout(View.java:11359)
at android.view.ViewGroup.layout(ViewGroup.java:4531)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1665)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2695)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4974)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:2)
我修好了。我正在设置从数据库中保存的值中选择的dafault,但这与我在微调器中的值的数量不匹配。谢谢你指出我正确的方向