Fustigador
Fustigador

Reputation: 6469

InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS in Samsung

In my app, I have an EditText, with a button to change the keyboard input type. The code:

ToggleCambiarTeclado.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View view) {
        if (ToggleCambiarTeclado.isChecked()) {

            tipoDeTecladoActual = InputType.TYPE_CLASS_NUMBER;
            imagenTeclado.setImageDrawable(getResources().getDrawable(R.drawable.keyboard_numeric));
        } else {
            tipoDeTecladoActual = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
            imagenTeclado.setImageDrawable(getResources().getDrawable(R.drawable.keyboard_querty));

        }
        editNumeroContador.setInputType(tipoDeTecladoActual);
    }
});

It works perfectly in my phone...but my boss has a Samsung, and is not changing the keyboard type in his phone.

I have tried changing it to TYPE_TEXT_VARIATION_NORMAL, TYPE_TEXT_VARIATION_VISIBLE_PASSWORD and YPE_CLASS_TEXT, neither of them are working.

Anyone knows if this is a bug? Any known workaround?

Thank you.

EDIT:

Just realized my boss has TouchPal installed. If he changes the default keyboard to the standard it works perfectly...

Upvotes: 4

Views: 2546

Answers (2)

Tom
Tom

Reputation: 7824

Later Samsung devices have SwiftKey keyboards built in. SwiftKey intentionally decided at some point to ignore Android's InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS.

A workaround is to use InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD, which is somewhat hacky, but an unfortunately common workaround.

XML variant: android:inputType="textVisiblePassword"

Upvotes: 5

vguzzi
vguzzi

Reputation: 2428

Samsung's behave weirdly with most things. I've had this issue before and I seem to recall that changing the input type to email worked like a charm. Give it a try.

Upvotes: 0

Related Questions