2
I would like to know if it is possible to use a condition operator, such as if, to check whether a button is visible or not. If that’s how can I implement it? I made a few attempts using is.Enable but was unsuccessful.
2
I would like to know if it is possible to use a condition operator, such as if, to check whether a button is visible or not. If that’s how can I implement it? I made a few attempts using is.Enable but was unsuccessful.
4
If it is visibility you need to test you can use the method getVisibility view-class. The method exists in the class View but how Button derives from View, can use it directly.
The code would look like this:
if (meuBotao.getVisibility() == View.VISIBLE) {
    //código para quando está visivel
}
It has 3 visibility states that can test:
View.VISIBLEView.INVISIBLEView.GONEDocumentation for the view class and to the button class
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.