0
> 09-10 11:38:07.166: E/AndroidRuntime(11497): FATAL EXCEPTION: main
>     09-10 11:38:07.166: E/AndroidRuntime(11497): java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at java.util.ArrayList.get(ArrayList.java:311)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.ListView.dispatchDraw(ListView.java:3062)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.ExpandableListView.dispatchDraw(ExpandableListView.java:233)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.View.draw(View.java:7093)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.AbsListView.draw(AbsListView.java:2699)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1739)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1737)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.View.draw(View.java:6989)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.FrameLayout.draw(FrameLayout.java:361)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1739)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1737)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1737)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1737)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.View.draw(View.java:6989)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.FrameLayout.draw(FrameLayout.java:361)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1739)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.View.draw(View.java:6989)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.FrameLayout.draw(FrameLayout.java:361)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.drawChild(ViewGroup.java:1739)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1466)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.View.draw(View.java:6989)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.widget.FrameLayout.draw(FrameLayout.java:361)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1882)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewRoot.draw(ViewRoot.java:1544)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewRoot.performTraversals(ViewRoot.java:1280)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1882)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.os.Handler.dispatchMessage(Handler.java:99)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.os.Looper.loop(Looper.java:130)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at android.app.ActivityThread.main(ActivityThread.java:3701)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at java.lang.reflect.Method.invokeNative(Native Method)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at java.lang.reflect.Method.invoke(Method.java:507)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
>     09-10 11:38:07.166: E/AndroidRuntime(11497):  at dalvik.system.NativeStart.main(Native Method)

例外が発生しましたが、クラスを指す行番号がありません。では、どうすれば例外を見つけることができますか? 提案をありがとう

4

4 に答える 4

0

HeaderViewListAdapter.java:164

HeaderViewListAdapter.java クラスの 164 行目にエラーがあることを示しています。

于 2012-09-10T08:50:10.023 に答える
0

ここでおそらく起こることは、次のいずれかです。

  • 配列をアダプターに渡し、表示する前に変更します
  • アダプターをオーバーライドして、配列サイズと一致しない getCount() 値を返す
于 2012-09-10T08:50:25.073 に答える