I have a dynamically added EditTexts to my layout. They don't have id's. This EditTexts are all required and cannot be left empty. I have this function for validation:

```
private boolean validate() {
    boolean valid = true;
    for (int i = 0; i < layout.getChildCount(); i++) {
        if (layout.getChildAt(i).getTag() != null && layout.getChildAt(i).getTag().toString().contains("required")) {
            String viewClass = layout.getChildAt(i).getClass().getName(); 
            if (viewClass.contains("EditText")) {
                EditText et = (EditText) layout.getChildAt(i);
                if (et.getText().toString().trim().isEmpty()) {
                    Log.d("#########", "EDIT TEXT ERROR");
                    et.setError("This field is required.", getResources().getDrawable(R.drawable.indicator_input_error));
                    valid = false;
                }
            }
        }
    }
}

```

where `layout` is my layout containing the EditTexts. It gives me the log but it's not showing the error. If I change the `setError` line with

```
et.setText("#########");

```

the text is changed properly. Why isn't the error showing?