dynamic autocomplete textview displayes slowly,how to display faster?
<p>I have written some code for autocompletetextview in custom dialog box.When typing some text that text dynamically search into the hashmap.This hashmap is with large lines of text.It works.But slowly giving me result.</p>

<pre><code>AutoCompleteTextView searchText = (AutoCompleteTextView)searchDialog.findViewById(R.id.searchText);
    if(searchText.getText()!=null){
    //                  searchString = searchText.getText().toString().trim();
                    String[] autoList = getAutoCompletWords(searchText.getText().toString().trim());
                    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(ctx,android.R.layout.simple_dropdown_item_1line,autoList);
                    searchText.setAdapter(adapter);
                    }

private String[] getAutoCompletWords(String text){
        Set&lt;String&gt; wordsSet = new TreeSet&lt;String&gt;();
        Pattern wordPattern = Pattern.compile("\\b"+text+"\\w+",Pattern.CASE_INSENSITIVE);
        Matcher matcher = wordPattern.matcher(bookContentMap.values().toString());
        while(matcher.find()){
            wordsSet.add(matcher.group());
        }
        String[] wordsArray = wordsSet.toArray(new String[0]);
        return wordsArray;
    }
</code></pre>

<p>If I take thread for above code it is giving me thread handler exception.Please give me an idea for quick response of list on autocomplettext.</p>

<p>Rajendar Are</p>
