how to fix setOpenableLayout in layout Navigation Drawer Activity

Viewed 1344

i have a problem why is setOpenableLayout not working?

mAppBarConfiguration = new AppBarConfiguration.Builder(
                R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
                .setOpenableLayout(drawer)
                .build();

show error :

error: cannot find symbol .setOpenableLayout(drawer) ^ symbol: method setOpenableLayout(DrawerLayout) location: class Builder

maybe someone here can help me

2 Answers

What is your gradle config.

Look a problem of sdk versions. Try changing ".setOpenableLayout(drawer)" for ".setDrawerLayout(drawer)".

Anyway, it's possible for your minSdk method setOpenableLayout does not exist yet.

I'd advise to set higher version of androidx.navigation:navigation-ui (say 2.4.1).

Related