Google Play的崩溃报告

时间:2013-08-06 06:05:51

标签: android google-play crash-reports

我收到了来自Google Play的关于我的应用程序崩溃的邮件。 堆栈垃圾如下

java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at com.mycompanyname.myappname.Main$2.onScrollingFinished(Main.java:161)
at android.wheel.widget.WheelView.notifyScrollingListenersAboutEnd(WheelView.java:295)
at android.wheel.widget.WheelView$1.onFinished(WheelView.java:156)
at android.wheel.widget.WheelScroller.finishScrolling(WheelScroller.java:248)
at android.wheel.widget.WheelScroller$2.handleMessage(WheelScroller.java:220)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
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:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)

我是如何找到并修复此问题的,因为我已经彻底测试了它但没有发现这种类型的错误。任何建议如何找到该错误。

这是我滚轮滚动的代码

public void onScrollingFinished(WheelView wheel) {
            WheelScrolled = false;

            System.gc();

            ivImage.setImageResource(images[wheelview.getCurrentItem()]);
            tvName.setText(names[wheelview.getCurrentItem()]);              

            tvText.setText(_dataList.get(wheelview.getCurrentItem()).data);     

            System.gc();

        }
    });

1 个答案:

答案 0 :(得分:0)

您的数组在onScrollingFinished

中没有元素

尝试使用catch语句或检查wheelview.getCurrentItem()是否为NULL

您是如何初始化阵列的?你在哪里初始化它?您应该避免致电gc() more on it