What I had to do was to implement a text input able to color letters green or red. My piece of code can do this but there is a problem. I can’t write an national letter because the popup does not appear.
edit_text.addTextChangedListener(new TextWatcher() {
boolean input_changed = false;
private boolean isInputBlocked()
{
this.input_changed = !this.input_changed;
return !this.input_changed;
}
@Override
public void afterTextChanged(Editable s)
{
// Prevent recursive
if (isInputBlocked()) return;
// Some staff
Outer.this.edit_text.setText(Html.fromHtml(html_input.toString()));
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count)
{}
});
When I commented Outer.this.edit_text.setText(Html.fromHtml(html_input.toString()));, the popup appears.
The InputFilter helped me resolve the problem: