how can i make a label invisible at release build

406 Views Asked by At

I want to hide a listview item on release build but make it visible on debug build. I searched it on internet but I can't find anything about it. Anyone can help me?

1

There are 1 best solutions below

1
On

According to this post, there is an option to detect if an app is in debug or release mode:

if (BuildConfig.DEBUG) {
   lbl.setVisibility(View.VISIBLE);
} else {
   lbl.setVisibility(View.INVISIBLE);
}

Then you simply set the visibility based on the condition to visible or invisible.