Since there was no way to do this directly, I ended up creating my own adapter.
public class BarAdapter extends ArrayAdapter<Bar> {
}
This part was trivial, the only hard work to be done was to oversee the request from Foo → Bar, which would give me the results I wanted. In the end, it looked something like this,
RealmQuery<Foo> fooRealmQuery = realm
.where(Foo.class)
.equalTo("fooType", "desired type")
.or()
.equalTo("fooType", "other type");
RealmResults<Foo> fooList = fooRealmQuery.findAll();
List<Bar> barList = new ArrayList<Bar>();
for (Foo foo : fooList) {
Bar bar = foo.getBar();
if (!barList.contains(bar)) {
barList.add(bar);
Log.d(TAG, "added " + bar.getName());
} else {
Log.d(TAG, "I already had that bar");
}
}
adapter = new BarAdapter(this, barList);
listView.setAdapter(adapter);
. , Realm , , , :)