Search code examples
androidfloating-action-button

Get FloatingActionButton background color


Good night.

How do I get the background color of a FloatingActionButton? I'm using Android Studio with java language.

Thanks.


Solution

  • It's the very first method in the documentation:

    getBackgroundTintList()

    Just use

    fab.getBackgroundTintList().getDefaultColor();