-
Notifications
You must be signed in to change notification settings - Fork 354
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
findViewById, causing missing adapter error #37
Comments
Hi @DiogoTheCoder, |
Hi @tommybuonomo Example:
|
Are you sure that your |
Sorry but the code is clear: if (viewPager != null && viewPager.getAdapter() != null) {
...
} else {
Log.e(DotsIndicator.class.getSimpleName(), "You have to set an adapter to the view pager before !");
} You have an error somewhere in your code. |
I have similar issue. DotsIndicator call refreshDots() inside init(AttributeSet attrs) method when class initialize. So even viewPager = null at that moment. |
When I execute
DotsIndicator dotsIndicator = findViewById(R.id.dots_indicator_view_pager_insights);
, getting an error message straight awayDotsIndicator: You have to set an adapter to the view pager before !
I do set the adapter right after the
findViewById
, shouldn't the message appear later on, if no adapter has yet been set?The text was updated successfully, but these errors were encountered: