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
fails on nullpointerexception when setting a smiley for the first time #32
Comments
Are you sure it is null pointer? or IndexOutOfBounds exception |
Can you post the stackTrace of the error too? |
I guess mTouchPoints should be 5 (smilies) but it contains 0 because they were never created. I think. |
I hope the above will be enough but if you need more info from me, let me know |
I got the same error |
@LeooonH It seems that we're the only ones to get this error... I wonder what the problem is. Waiting for @sujithkanna response. |
Hi all, My code (simplyfied):
What am I doing wrong? Thank you for your AWESOME work! :D |
It is because the view is not inflated yet fully, so try posting it using runnable.
Can you try this? Thank you :D |
solution by @sujithkanna works! same problem with animate and the snippet works fine |
Your work is awsome! but now I need to make it work :) I follow the 3 steps in the usage part and I see the smilies in the designer preview. I did the following in an adapter:
RatingViewHolder(View itemView) {
super(itemView);
srRating = (SmileRating) itemView.findViewById(R.id.smile_rating);
srRating.setIndicator(true); //<< srRating is not null and this line works
}
@OverRide
public void onBindViewHolder(final RatingViewHolder holder, int position) {
Rating theRating = RatingList.get(position);
holder.srRating.setSelectedSmile(5,true); << fails*
}
moveSmile(mTouchPoints.get(mSelectedSmile).x); <<< fails mTouchPoints size is 0
I put a breakpoint in line 255: createTouchPoints() but it never reaches there before the above code so it fails on nullpointerexception because there is no position 5
Please advice, it seems that this is working for everyone so I wonder if I miss something
Thanks
The text was updated successfully, but these errors were encountered: