Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MultiautoCompleteTextView ime keyabord does not show suggestions

I'm using MultiautoCompleteTextView. it works perfect. strange problem though that some devices do not show keyboard suggestions:

Using Nexus 5 Using nexus 5

Using galaxy s6 Using galaxy s6

Some Code

<MultiAutoCompleteTextView
    android:id="@+id/fragment_write_text_editText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/text_editor_margin_top"
    android:gravity="start|top"
    android:hint="@string/enter_text"
    android:imeOptions="normal"
    android:inputType="textCapSentences|textMultiLine|textAutoComplete"
    android:maxLength="1200"
    android:backgroundTint="@color/primary"
    android:textSize="16sp"/>

public void setupEditorBox (View view) {
    mEditTextBox = (MultiAutoCompleteTextView) view.findViewById(R.id.fragment_write_text_editText);
    mEditTextBox.setThreshold(1);
    mEditTextBox.setTokenizer(new HashTagTokenizer());
    mEditTextBox.setAdapter(new HashTagAutocompleteAdapter(getActivity(), R.layout.auto_complete_tag_item));
    mEditTextBox.setOnItemClickListener(this);
}
like image 243
royB Avatar asked Jun 21 '15 14:06

royB


1 Answers

In Nexus Devices you can fix it setting the InputType.

mEditTextBox.setInputType(InputType.TYPE_CLASS_TEXT);

At least with a simple ArrayAdapter and the MultiAutoCompleteTextView.CommaTokenizer, setting the InputType fix this issue.

like image 118
isma3l Avatar answered Oct 24 '22 02:10

isma3l