How to populate data in AutoCompleteTextView?
<p>I have to show two section in <code>AutoCompleteTextView</code> (Something like this):</p>

<p><a href="https://i.stack.imgur.com/gyjcS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gyjcS.png" alt="enter image description here"></a></p>

<p>I have created a <code>custom layout</code> which have two <code>CardViews</code> and each <code>CardView</code> have three <code>TextViews</code>. Right now I am not distributing the section on the basis of <code>type</code>. The whole data is loaded into one section. </p>

<h1>Activity</h1>

<pre><code>final AutocompleteLocalityAdapter adapterLocalities = new AutocompleteLocalityAdapter(context,
                 R.layout.support_simple_spinner_dropdown_item, new ArrayList&lt;Locality&gt;());
</code></pre>

<h1>AutocompleteLocalityAdapter</h1>

<pre><code>public class AutocompleteLocalityAdapter extends ArrayAdapter&lt;Locality&gt; {
public AutocompleteLocalityAdapter(Context context, int layout, List&lt;Locality&gt; localities) {
    super(context, layout, localities);
    this.localities = localities;
    updateList("");
}
</code></pre>

<p>In <code>updateList</code> method I am making a new network call to fill the data in <code>Locality</code> class.</p>

<p>What do I need to do to categories the search result as per given image? <code>ArrayAdapter</code> is not going to work here for sure. </p>

<p>The possible solution I am thinking here is: 
 Replace <code>ArrayAdapter</code> to <code>RecyclerViewAdapter</code>. </p>

<p>Any hint will be appreciable. </p>