android - Get informed which button in popup window has been clicked -


im trying implement feature of small android app. there image button, , popup window appear when click it. according button in popup window user click, image button should change image accordingly. when click 1 in popup window, should inform button update image 1.

can tell me how this?

enter image description here

you can make use of following method

public void settabfor(button btn) {          (button button : btnarray) {         if (button == btn) {                  if (button == button_one) {                     utils.settabbutton(r.drawable.left_selected, button_one);                  } else if (button == button_two) {                      utils.settabbutton(r.drawable.middle_selected, button_two);                  } else if (button == button_three) {                     utils.settabbutton(r.drawable.middle_selected, button_three);                  } else {                     utils.settabbutton(r.drawable.right_selected, button_four);                  } } 

where settabbutton in utils class used set backgrounddrawable:

public static void settabbutton(int drawable, button... btn) {         (button button : btn) {             button.setbackgroundresource(drawable);         }     } 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -