Closed PinkFloyded closed 8 years ago
I noticed that for each token that's selected, a comma and a space is added. I changed the query string to
String text = countryCompletionView.getText().toString(); text = text.replace(",",""); text = text.replace(" ","");
Then change the adapter using citiesAdapter.notifyDataSetChanged();
Please let me know if there is a better way.
you should use currentCompletionText
to get the text you should use for searching. You should be able to combine this with some kind of adapter that queries a remote source to search with REST calls. This isn't something I've done before, but there should be android tutorials for loading remote data into an adapter.
For getting the text excluding completions, you'll need to do some mangling on getText(). I don't really recommend this as the exact text formatting is not something I guarantee for future versions.
I'm trying to dynamically update the adapter per token by making a REST call. Is there a recommended way to do this using this widget? Also how do I get the text excluding previous selections, that is the current incomplete text so that I can make a REST call with that as a query?