how to implement filterable in RealmRecyclerViewAdapter

Move the filtering to publishResults and use the UI thread Realm’s queries to evaluate the new results. private class AirportAdapter extends RealmRecyclerViewAdapter<AirportR, RecyclerView.ViewHolder> implements Filterable { Realm realm; public AirportAdapter(Context context, Realm realm, OrderedRealmCollection<AirportR> airports) { super(context, airports, true); this.realm = realm; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.airport_show, … Read more

How to dynamically add suggestions to autocompletetextview with preserving character status

one of the easiest way of doing that (put the code in onCreate): EDIT: addied wikipedia free opensearch (if https://en.wikipedia.org doesn’t work try http://en.wikipedia.org) AutoCompleteTextView actv = new AutoCompleteTextView(this); actv.setThreshold(1); String[] from = { “name”, “description” }; int[] to = { android.R.id.text1, android.R.id.text2 }; SimpleCursorAdapter a = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, null, from, to, 0); a.setStringConversionColumn(1); … Read more