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

Popular posts from this blog

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -