Quick Tip — How to set the visibility of a button

Statically

<Button
<!--Some attributes-->
android:visibility=invisible
<!--Some other attributes -->
/>

Dynamically

Button button = findViewById(R.id.buttonId);
button.setVisibility(View.INVISIBLE);

Interesting links

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Transfer tab added in PointPay Banking app for Android

Data Binding in Android — Divami

Data binding

Android Architecture Pattern

An amazing Analytics architecture for Android app. Part 1

Nested RecyclerView In Android

Creating a Fluidsynth Hello World App for Android

Android: (Part1) Introduction to Coroutines

Adventures in GameDev with GameDevHQ! Day 22: Determining how long powerup effects should last.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Xavier Jouvenot

Xavier Jouvenot

More from Medium

Design Patterns in Kotlin: Visitor

How unit test can enhance our code quality?

Making Stop watch using compose Desktop

JDK 17 — Unsupported Class File Major Version