extracting color code on button click-android -



extracting color code on button click-android -

is there way extract color code (background color) of button on clicking , using in curresponding java code?

the purpose same identifier on clicking same colored buttons in different activities.

you can utilize getcurrenttextcolor()

button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { int color = button.getcurrenttextcolor(); } });

android button

Comments