android - Why wont the button disappear? -


im trying develop android app, , 1 of features when hitting button, should button disappears. this, not work, can explain me why? thanks!

    button startbutton = (button) findviewbyid(r.id.startbutton);     startbutton.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view view){                 view thisbutton = findviewbyid(r.id.startbutton);                 thisbutton.setvisibility(view.gone);         }      }); 

try following:

    button startbutton = (button) findviewbyid(r.id.startbutton);                 startbutton.setonclicklistener(new onclicklistener() {             @override             public void onclick(view view) {                 view.setvisibility(view.gone);             }         }); 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -