{"comment":{"created_at":"2011-10-24T19:39:56Z","body":"Hi, thank you for the report. It's hard to tell from the crash why this occurs. Can you provide an example app that triggers this or a description of how to trigger it in the example app?","updated_at":"2011-10-24T19:39:56Z","url":"https://api.github.com/repos/johannilsson/android-pulltorefresh/issues/comments/2508310","id":2508310,"user":{"avatar_url":"https://secure.gravatar.com/avatar/fa6595df828624e971ab01182fda8704?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fa6595df828624e971ab01182fda8704","url":"https://api.github.com/users/johannilsson","id":43943,"login":"johannilsson"}},"action":"created","issue":{"number":36,"created_at":"2011-10-24T16:20:08Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I have implemented PullToRefreshView in my project but sometimes at startup the app crashes with the following log:\r\n\r\n```java\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): FATAL EXCEPTION: main\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat java.util.ArrayList.get(ArrayList.java:311)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.widget.ListView.dispatchDraw(ListView.java:3061)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.View.draw(View.java:7003)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.widget.AbsListView.draw(AbsListView.java:2641)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1646)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.View.draw(View.java:6900)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1646)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.View.draw(View.java:6900)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.widget.FrameLayout.draw(FrameLayout.java:357)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1646)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.View.draw(View.java:6900)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.widget.FrameLayout.draw(FrameLayout.java:357)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1908)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewRoot.draw(ViewRoot.java:1527)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewRoot.performTraversals(ViewRoot.java:1263)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.view.ViewRoot.handleMessage(ViewRoot.java:1865)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.os.Looper.loop(Looper.java:130)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat android.app.ActivityThread.main(ActivityThread.java:3835)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat java.lang.reflect.Method.invoke(Method.java:507)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)\r\n10-24 13:16:29.067: E/AndroidRuntime(3667): \tat dalvik.system.NativeStart.main(Native Method)\r\n```\r\n\r\nIs there someting I am doing wrong? I have added the widget in my xml and set adapter in onCreate...","comments":1,"title":"Crash at startup","updated_at":"2011-10-24T19:39:58Z","url":"https://api.github.com/repos/johannilsson/android-pulltorefresh/issues/36","id":2035452,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/2b3a3e3d7803373a861b3986a88949ea?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2b3a3e3d7803373a861b3986a88949ea","url":"https://api.github.com/users/dmarcato","id":749308,"login":"dmarcato"},"html_url":"https://github.com/johannilsson/android-pulltorefresh/issues/36","labels":[],"state":"open"},"legacy":{"issue_id":2035452,"comment_id":2508310}}