I am trying to change the background color of a layout using a html color reference. But i cant seem to make it work. Here is how i am trying to do it
public class FormEngine {
Context context;
RelativeLayout relLayout;
FormEngine(Context ctx) {
context = ctx;
relLayout = new RelativeLayout(context);
}
public void clearScreen(int color) {
relLayout.setBackgroundColor(color);
}
} and this is how i am calling this class
FormEngine fEngine = new FormEngine(MainActivity.this);
setContentView(fEngine.relLayout);
fEngine.clearScreen(0x708090);
Now if i simply try to use Color.Yellow in setBackground color It works as expected but when i pass a color value like this , it simply shows a white background. Any help would be appreciated.