我想知道是否可以将SyncUser列表作为管理员?
我尝试这样的事情:
public class AdministrationActivity extends AppCompatActivity {
private RealmConfiguration config;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_administration);
SyncConfiguration syncConfiguration = new SyncConfiguration.Builder().
config = new RealmConfiguration.Builder().deleteRealmIfMigrationNeeded().build();
Realm realm = Realm.getInstance(config);
Collection<SyncUser> users = SyncUser.all();
List<String> identities = new ArrayList<>();
if (Build.VERSION.SDK_INT >= 24) {
identities = users.stream().map(SyncUser::getIdentity).collect(Collectors.toList());
identities.forEach(System.out::println);
}else{
for(SyncUser u : users){
identities.add(u.getIdentity());
Log.i("TEST",u.getAccessToken() + "_" +u.getIdentity());
}
}
}
}
但是,当我这样做时,我只有一个用户,我刚刚连接的用户。 该用户是admin(在Realm对象服务器上)
所以我的问题是:有办法吗?
此致