EditText editText = findViewById(R.id.editText); editText.setBackgroundColor(getResources().getColor(R.color.blue));
EditText editText = new EditText(this); editText.setBackgroundColor(Color.GREEN);In this example, we create a new `EditText` object and set its background color to green using the `Color.GREEN` constant. The package library for this class is `android.widget`.