Google Documentation
Try with the function public static int parseColor (String colorString) That take a String and return the int color!
Parse the color string, and return the corresponding color-int. If the string cannot be parsed, throws an IllegalArgumentException exception. Supported formats are: #RRGGBB #AARRGGBB or one of the following names: 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'.
Try something like this
//find your layout LinearLayout ll = (LinearLayout) findViewById(R.id.yourLinearLayout); //Get the color from an EditText EditText newcolor = (EditText) findViewById(R.id.yourEditText); String stringColor = newcolor.getText().toString(): //Assume that you have the #RRGGBB //the function take only #RRGGBB with 6 values read documentation for more information int intColor = Color.parseColor(stringColor); //Set the color to the LinearLayout ll.setBackground(intColor);