-
Notifications
You must be signed in to change notification settings - Fork 664
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
NullPointerException after screen orientation change #16
Comments
Here is how I've fixed this issue: final int top = getPaddingTop();
for(int i = 0; i<colCount; i++){
- final int offset = top + ((mRestoreOffsets != null)? Math.min(mRestoreOffsets[i], 0) : 0);
+ int offset = top;
+ if((mRestoreOffsets != null) && mRestoreOffsets.length == colCount)
+ offset += Math.min(mRestoreOffsets[i], 0);
mItemTops[i] = (offset == 0) ? mItemTops[i] : offset;
mItemBottoms[i] = (offset == 0) ? mItemBottoms[i] : offset;
} |
Thanks for the fix. Worked for me. |
Thanks. This solves my excpetion during a screenOrientation change. |
Thanks, saved me! |
Thanks..worked for me too! |
works. time to merge it in? :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have case when for portrait orientation I have one column and for landscape two columns. If we rotate from portrait to landscape we'll get NullPointerException. Stacktrace:
The text was updated successfully, but these errors were encountered: