New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayOutOfBoundsException when adding items #24
Comments
Could you attach the arrays that you are using? Both strings and drawables if you are using them. |
I've copy/pasted the example from README and it crashes if I add anything more in it, it's enough to add 1 more entry to crash...
The icons are default, didn't even touch that part... |
You have 3 list items and only 2 drawables, when it tries to get the drawable that's missing, the app crashes. I should add a better exception for this case. I just tried the same code as you adding another drawable and it worked fine. With only two, it crashed. |
Oh, I thought you set 1 drawable for main list and 1 for secondary that repeat themselves thru the list because in the example you have 2 drawables set for 2 items in main list and none for secondary so I just assumed that first drawable is for main list and second for secondary... |
Then I should explain that better in the README, too 😄. Each drawable matches one entry. You can set an array of ids for main and another for secondary items, but it must be an array. I'm closing this as it's not a real bug, but I'll try to get some time and add better documentation and an exception. Thank you. |
Hi! I've copied the exact same example from README.md and everything works with it. But when I add items in arrays.xml the app crashes with ArrayOutOfBoundsException. Here's the logcat:
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=12; index=12
at android.content.res.TypedArray.getResourceId(TypedArray.java:571)
at org.arasthel.googlenavdrawermenu.views.GoogleNavigationDrawer.configureWithTypedArray(GoogleNavigationDrawer.java:235)
at org.arasthel.googlenavdrawermenu.views.GoogleNavigationDrawer.(GoogleNavigationDrawer.java:89)
The text was updated successfully, but these errors were encountered: