0

Friend's I'm working upon searching in maps, here i have string in my array,when i enter characters for searching in Edit text box,i need the string have started with similar character in my result.
for example in my array i have String[] name ={"A","B","BB","Boys","Box"}

Initially i have all the array string in my result,if i suppose enter an character like b in editbox i need filter and show the charcters matches with b that is "B","BB",""Boys","Box",if suppose i enter two characters like "bo"in editbox ,i need result strings "Boys","Box"in another array. Help me.

thanks in advance.

1 Answer 1

1

Consider using AutoCompleteTextView instead of simple EditText.

Sign up to request clarification or add additional context in comments.

5 Comments

Well, AutoCompleteTextView is meant for such functionality. It looks like EditText, but you can populate it with array of strings (using ArrayAdapter) and drop-down of suggestions will pop up when you will start entering text (exactly as you described).
I tried the sample given in the document,but it doesn't show the string in the dropdown list,what is wrong with it,it simple displays the autocompltetextview box with out string content,please help me
Populating AutoCompleteTextView is very similar to populating ListView or Spinner. Did you set completionThreshold attribute to desired value (1 in your case)? In general, latter problem description is too laconic to really answer what is causing that.
here we set threshold for setting characters to match array of strings from array and then display's it,how can i display all the array content initially,before entering characters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.