In the previous post I have showed how to create gradient buttons in android using XML.
This is how we do this in java code.
Button b = (Button)findViewById(R.id.Button01); b.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
This is another method of applying gradiant.
b.getBackground().setColorFilter(new LightingColorFilter(0xFF00FF00, 0xFFAA0000));
Please leave your valuable comments.
Pingback: How to show a sliding window from below in Android? | Coderz Heaven