Constants in the Android SDK

When using setVisibility (int) int, there can be VISIBLE, INVISIBLE, and GONE. These, when I look at them, have (obviously) a set of int values. However, I cannot just insert (say) "GONE" because it is not recognized. How to import definitions, or should I define them in my own code?

+3
source share
2 answers

Just put it import static android.view.View.GONEunder your import, and you can directly use the constant GONEwithout requiring additional qualifiers.

+5
source

android.view.View.GONE These are the constants defined in the view.

+1
source

Source: https://habr.com/ru/post/1791166/


All Articles