You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
12-17 12:56:50.135 31831-31831/com.zhongzilu.bit100 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.zhongzilu.bit100, PID: 31831
java.lang.ArrayIndexOutOfBoundsException: length=14; index=-1
at java.util.ArrayList.get(ArrayList.java:310)
at com.zhongzilu.bit100.view.fragment.FolderManagerFragment.onItemClick(FolderManagerFragment.java:629)
at com.zhongzilu.bit100.view.adapter.FileListAdapter.lambda$onBindViewHolder$0(FileListAdapter.java:144)
at com.zhongzilu.bit100.view.adapter.FileListAdapter.access$lambda$0(FileListAdapter.java:0)
at com.zhongzilu.bit100.view.adapter.FileListAdapter$$Lambda$1.onClick(Unknown Source)
最近在移植该项目代码,移植成功后
(FileListAdapter代码我没改动)
,发现一个数组越界报错,当我列表中存在几个文件时,第一次点击文件可以进入编辑,然后快速退出再点击另一文件时就会报该错误什么原因导致的我还不清楚
解决方法
将以下代码中的
getAdapterPosition()
方法换成getLayoutPosition()
即可The text was updated successfully, but these errors were encountered: