I'm trying to to the following things:
Retrieve all the option-values from an URL (working)
Pass them to a String[] in my app (working)
Set up an AutoCompleteTextBox with the values of this String Array (not working).
I leave here my piece of code:
protected Elements doInBackground(Void... arg0) {
try {
Document doc = Jsoup.connect("http://pedidos.pizzeriabritannia.com/index.asp?Opc=Registro").get();
Elements options = doc.select("select#calle option");
return options;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
protected void onPostExecute(Elements options){
for (int i = 0; i < options.size(); i++){
calles[i] = html2text(options.get(i).toString());
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Registro.this,android.R.layout.simple_dropdown_item_1line,calles);
acTextView.setThreshold(2);
acTextView.setAdapter(adapter);
}
The AutoCompleteTextBox should work as follows, for example:
If I write MA, it would suggest me MADRID, MALAGA, MASSACHUSETTS...
but it does not show anything. I'm sure that the String has been populated.
Any suggestion??