android - How to do this query in background with AutoCompleteTextView? -
i've made code:
public view oncreateview(final layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.fragment_search, container, false); button search = (button)view.findviewbyid(r.id.cerca); andata = (autocompletetextview)view.findviewbyid(r.id.andata); ritorno = (autocompletetextview)view.findviewbyid(r.id.ritorno); //set adapters parsequery<parseobject>query = parsequery.getquery("stations"); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> list, parseexception e) { if(e == null) { for(int = 0; i<list.size();i++) { string name = list.get(i).getstring("code"); stationnames.add(name); } string [] stradapter = new string[stationnames.size()]; stradapter=stationnames.toarray(stradapter); arrayadapter<string>adapter = new arrayadapter<string>(getactivity(),android.r.layout.simple_list_item_1,stradapter); andata.setadapter(adapter); ritorno.setadapter(adapter); } else { e.printstacktrace(); } } });
and problem there 50k stations download parse..my question is: it's possible start download after 3 character written? example after digit "pin" query parse starts... thank
Comments
Post a Comment