android - How to set focus on button if clicked and buttons are made in xml -


i have created 3 buttons , want change focus of button clicked user using coding there way ?

i have seen these links

link1

link2

but want know when made instances of these 3 buttons want focus clicked @ time , want change focuscolor on click defined me using coding? can tell me?

   final button button = (button) findviewbyid(r.id.button_id);      button.setfocusable(true);       button.setonfocuschangelistener(new view.onfocuschangelistener() {          @override         public void onfocuschange(view v, boolean hasfocus) {             // todo auto-generated method stub          }     }); 

try sample code


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -