Material-components-android: BottomAppBar replaceMenu() doesn't work

Created on 7 Jun 2018  路  6Comments  路  Source: material-components/material-components-android

Overview

BottomAppBar replaceMenu() has no effect. Also, setting menu through XML also has no effect

Version number

com.google.android.material:material:1.0.0-alpha1

Operating system and device

MacOS, Nexus 5X

Most helpful comment

The problem seems to be setSupportActionBar(bottomAppBar) used together with replaceMenu. Just remove setSupportActionBar and everything will be fine.

All 6 comments

Does your activity extends AppCompatActivity?

Yes, it extends androidx.appcompat.app.AppCompatActivity

Without seeing your code I cannot comment much but I have made it work.
I have written the implementation details on Medium, can you check the link below to see what is missing?

https://android.jlelse.eu/implementing-bottomappbar-material-components-for-android-f490c4a01708

I checked your post but it didn't help
Here is the sample code. Can you tell me please how to inflate a menu using bottomAppBar.replaceMenu()
Thanks

The problem seems to be setSupportActionBar(bottomAppBar) used together with replaceMenu. Just remove setSupportActionBar and everything will be fine.

Yes, it works now. Thank you!

Was this page helpful?
0 / 5 - 0 ratings