[Solved] setAdapter not recognize in android studio [duplicate]


Replace

ViewPager.setAdapter(...

with

viewPager.setAdapter(...

ViewPager (with a capital letter) is a class name and by using it here, you are trying to access the static method of that class. There is no static method setAdapter and hence the error.

For readability, replace viewPager with pager. It will make it easier for you to avoid such mistakes and the code will be more readable 🙂

solved setAdapter not recognize in android studio [duplicate]