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 filter a RecyclerView with a SearchView

Introduction Since it is not really clear from your question what exactly you are having trouble with, I wrote up this quick walkthrough about how to implement this feature; if you still have questions feel free to ask. I have a working example of everything I am talking about here in this GitHub Repository. In … 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