suggest change
try (Realm realm = Realm.getDefaultInstance()) {
    realm.executeTransaction(new Realm.Transaction() {
            public void execute(Realm realm) {
                //whatever Transaction that has to be done
    //No need to close realm in try-with-resources

The Try with resources can be used only from KITKAT (minSDK 19)

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents