I want to show/hide Google Material Floating Action button programmatically. I'm using Google Material library
implementation 'com.google.android.material:material:1.1.0'
And use the following code
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
FloatingActionButton fab = findViewById(R.id.fab);
fab.hide() // This is the method to hide the button as the Documentation But This does not hide the button
fab.setVisibility(View.GONE) // Neither this work,
}
Is there any other specific method to hide it?