@SuppressWarnings("WeakerAccess") public void updateRealmResults(RealmResults<T> queryResults){
  if (changeListener != null && realmResults != null)   realmResults.removeChangeListener(changeListener);
  realmResults=queryResults;
  if (realmResults != null && changeListener != null)   realmResults.addChangeListener(changeListener);
  selectedPositions.clear();
  lastSelectedPos=-1;
  ids=getIdsOfRealmResults();
  notifyDataSetChanged();
}

@ SuppressWarnings ( "WeakerAccess" ) public void updateRealmResults ( RealmResults < T > queryResults ) { if ( changeListener != null && realmResults != null ) realmResults . removeChangeListener ( changeListener ) ; realmResults = queryResults ; if ( realmResults != null && changeListener != null ) realmResults . addChangeListener ( changeListener ) ; selectedPositions . clear ( ) ; lastSelectedPos = - 1 ; ids = getIdsOfRealmResults ( ) ; notifyDataSetChanged ( ) ; }
update the realmresults associated with the adapter . useful when the query has been changed . if the query does not change you might consider using the automaticupdate feature .
