Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Android Studio shows setupWithNavController not exists?

NavigationUI.setupWithNavController(bottomNavigationView, navController)

When I run the app, the code is fine, but why it keeps showing compile error like this ?

The bottom navigation I use is in com.google.android.material:material, and the bottom navigation in the param is android.support.design.widget.BottomNavigationView. I know they are the same thing, but why it complains ?

enter image description here

like image 598
JIE WANG Avatar asked Oct 11 '18 20:10

JIE WANG


People also ask

How to Create navigation drawer in Android Studio?

To add a navigation drawer, first declare a DrawerLayout as the root view. Inside the DrawerLayout , add a layout for the main UI content and another view that contains the contents of the navigation drawer.

What is AppBarConfiguration in Android Studio?

AppBarConfiguration.OnNavigateUpListener. Interface for providing custom 'up' behavior beyond what is provided by androidx.


1 Answers

Just restart Android Studio. The lint gets confused sometimes.

like image 157
TheWanderer Avatar answered Nov 15 '22 07:11

TheWanderer