---In android application ---
after a button clicked,its background color is changed to required. as clicked again,its color will restore original color.
How to implement it?
any response,thank you!
================================================================================== Update: From network,i find a method to achieve this aim. design a drawable color in xml like this:
<drawable name="button_checked">#ffff0000</drawable>
in activity,use below code to get Drawable object:
Resources resource = getBaseContext().getResources();
checked_drawable = resource.getDrawable(R.drawable.button_checked);
in onClick function,according to a boolean variable:
setBackgroundDrawable(checked_mDrawable)
to set button background.