1Caused by: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
2 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
3 at java.util.ArrayList.get(ArrayList.java:308)
4 at com.mama100.android.member.activities.message.adapter.MessageListAdapter.getItem(MessageListAdapter.java:86)
5 at com.mama100.android.member.activities.message.MessageListActivity.onActivityResult(MessageListActivity.java:651)
修改前:
MsgTable msg = ((MsgTable) mMsgListAdatper.getItem(location));
修改后:
MsgTable msg = mMsgListAdatper.getList().get(location);
原因是:listView加了头部跟底部哇 证据如下 这里要注意呢
mAbPullListView.getHeaderView().setHeaderProgressBarDrawable(
getResources().getDrawable(R.drawable.progressbar_loading_anim));
mAbPullListView.getFooterView().setFooterProgressBarDrawable(
getResources().getDrawable(R.drawable.progressbar_loading_anim));
原文地址:http://mama100tech.blog.51cto.com/8943983/1659692