4

我更新了我的应用程序并突然收到此错误。因为我的代码中没有行,所以我无法确定它的头部或尾部。

人们已经在我在一个模拟器上看到的手机上看到了这个,但在我的家用机器上它工作正常。删除数据库并重新开始,仍然没有

欢迎任何想法谢谢

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)
4

1 回答 1

2

我已经修好了。我正在设置一个从数据库中保存的值中选择的默认值,但这与我在微调器中的值的数量不匹配。感谢您为我指明正确的方向

于 2013-01-09T13:09:43.727 回答