try-with-resources

suggest change
try (Realm realm = Realm.getDefaultInstance()) {
    realm.executeTransaction(new Realm.Transaction() {
            @Override
            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:

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



Table Of Contents