Reputation: 31
Is there a control for android that mimics the autocomplete and "autobox"(like in gmail app where after you select a email it puts the contact into a box and places it in the textbox) for email compose?
Upvotes: 2
Views: 1410
Reputation: 3348
Are you for looking for something like this:
main.xml
<MultiAutoCompleteTextView
android:id="@+id/compose_to"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="To"
android:imeOptions="actionNext"
android:textColor="#000000"
android:inputType="textEmailAddress|textMultiLine"
/>
main.java
MultiAutoCompleteTextView to = (MultiAutoCompleteTextView) findViewById(R.id.compose_to);
ArrayList<String> addresses = new ArrayList<String>();
addresses.add("[email protected]");
addresses.add("[email protected]");
addresses.add("[email protected]");
addresses.add("[email protected]");
ArrayAdapter<String> autocompAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, addresses);
to.setAdapter(autocompAdapter);
to.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
Upvotes: 2