2011-05-27 22 views

Respuesta

18

Leer el manual de vez en cuando no hace daño:

http://developer.android.com/reference/android/view/View.html#isEnabled%28%29

Ejemplo:

ImageButton myButton = (ImageButton) findViewById(R.id.epic_button); 

if (myButton.isEnabled()){ 
    //then the button is enabled. 
} 
+2

no se pierde nada de Por supuesto. Estaba buscando getEnable() y no pensé en isEnable() – atbebtg

+0

:) Como regla general, para alternar propiedades por ahí, tendrá un "setProperty" para establecerlo, y un "isProperty" para comprobar lo que está su valor^_^ – DallaRosa

+0

Definitivamente lo tendré en cuenta! Gracias. :) – atbebtg

10
button.isEnabled() 

devuelve true si se ha habilitado

Cuestiones relacionadas