Search code examples
androidrealmrealm-mobile-platform

Accessing multiple realm databases simultaneously


I have two users who have made realm databases. User1 has given admin access level to User2. Both create a list of objects. How can User2 get a list of objects made by himself and User1?

Currently User2 can access only 1 realm database on signing in.

I am using android.


Solution

  • If you are having two db, means you have two RealmConfiguration, one for each. You can get the realm appropriate db by calling Realm realm = Realm.getInstance(realmConfigurationInstance). Whichever, configuration you will pass, you will get that instance of the db.