<h3><span style="color: #000080;"><strong>Multi AutoComplete Textview</strong></span></h3>
<p>An editable text view, extending <strong><span style="color: #008000;">AutoCompleteTextView</span></strong>, that can show completion suggestions for the substring of the text where the user is typing instead of necessarily for the entire thing.</p>
<p><strong><span style="color: #008000;">MultiAutoCompleteTextView</span></strong> can hold multiple string words value at single time. These all values are separated by comma(,).</p>
<p>Get <span style="color: #0000ff;"><strong>GITHUB</strong></span> code from <span style="color: #0000ff;"><a style="color: #0000ff;" href="https://github.com/arunk7839/MultiSelectionAutoCompleteTextview"><strong>Here</strong></a></span>.</p>
<p><span class="embed-youtube" style="text-align:center; display: block;"><amp-youtube data-videoid="stNyalERgZk" data-param-rel="1" data-param-showsearch="0" data-param-showinfo="1" data-param-iv_load_policy="1" data-param-fs="1" data-param-hl="en-US" data-param-autohide="2" data-param-wmode="transparent" width="1200" height="675" layout="responsive"><a href="https://www.youtube.com/watch?v=stNyalERgZk" placeholder><amp-img src="https://i.ytimg.com/vi/stNyalERgZk/hqdefault.jpg" alt="YouTube Poster" layout="fill" object-fit="cover"><noscript><img src="https://i.ytimg.com/vi/stNyalERgZk/hqdefault.jpg" loading="lazy" decoding="async" alt="YouTube Poster"></noscript></amp-img></a></amp-youtube></span></p>
<p> ;</p>
<h3><strong><span style="color: #000080;">Creating New Project</span></strong></h3>
<ol>
<li>In Android Studio, go to<span style="color: #008000;"> <strong>File </strong><strong>⇒</strong><strong> New Project</strong></span> and fill all the details required to create a new project. When it prompts to select a default activity, select <span style="color: #008000;"><strong>Blank Activity</strong></span> and proceed.</p>
</li>
<li>
<p>Open<span style="color: #008000;"> <strong>activity_main.xml</strong></span> in which I have add one <strong><span style="color: #008000;">MultiAutoCompleteTextview</span></strong> with following basic properties.</p>
</li>
</ol>
<p><span style="color: #0000ff;"><strong>activity_main.xml</strong></span></p>
<!-- WP QUADS Content Ad Plugin v. 3.0.1 -->
<div class="quads-location quads-ad2" id="quads-ad2" style="float:none;margin:0px;">

</div>

<pre><;?xml version="1.0" encoding="utf-8"?>;
<;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:padding="18dp"
 tools:context="com.example.lenovo.multiautocompletetextview.MainActivity">;

 <;MultiAutoCompleteTextView
 android:id="@+id/mac_tv"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:background="@android:color/holo_blue_light"
 android:textSize="25sp" />;

<;/android.support.constraint.ConstraintLayout>;
</pre>
<p>3.Now open <span style="color: #008000;"><strong>MainActivity.java</strong></span> and and add the below code. The following code snippet shows<br />
how to create a text view which suggests various countries names while the user is typing:</p>
<p><span style="color: #0000ff;"><strong>MainActivity.java</strong></span><br />
<code></code></p>
<pre>package com.example.lenovo.multiautocompletetextview;

import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.MultiAutoCompleteTextView;

public class MainActivity extends AppCompatActivity {

 String[] country = {"Australia", "Albania", "Belgium", "Bhutan", "Canada", "China", "India"};

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);


 <span style="color: #008000;"><strong>//We can use any of the built_in android layout simple_list_item_1 and select_dialog_item</strong></span>
 ArrayAdapter<;String>; adapter = new ArrayAdapter<;String>;(this, android.R.layout.simple_list_item_1, country);

 MultiAutoCompleteTextView mac_tv = (MultiAutoCompleteTextView) findViewById(R.id.mac_tv);

 <strong><span style="color: #008000;">//Start character for search</span></strong>
 mac_tv.setThreshold(1);

 <strong><span style="color: #008000;">//Setting adapter</span></strong>
 mac_tv.setAdapter(adapter);

 <strong><span style="color: #008000;">// set tokenizer that distinguish the various substrings by comma</span></strong>
 mac_tv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());

 <strong><span style="color: #008000;">//Setting textcolor after selection</span></strong>
 mac_tv.setTextColor(Color.BLUE);
 }
}


</pre>
<h5><span style="color: #0000ff;"><strong>Now when you run the app it will look like this:</strong></span></h5>
<p><img class="aligncenter wp-image-183 " src="https://c1ctech.com/wp-content/uploads/2018/03/Screenshot_2018-03-06-19-04-091.png" alt="" width="456" height="760" /></p>
<p> ;</p>


