title: How to close realm object in android
body: <p>I'm trying to check if any realm object is in transaction, so that I can remove entire DB. But this statement always <code>returns false</code>.  <code>Realm.getDefaultInstances().isClose()</code>  where I have done wrong. someone explain me please.</p>
  
  <pre><code> if(!Realm.getDefaultInstances().isInTransaction()){
  
      Realm.getDefaultInstances().close();
      if(Realm.getDefaultInstances().isClosed()){
         Realm.getDefaultInstance().executeTransaction(new Realm.Transaction(){
                      @Override
                      public void execute(Realm realm) {
                          realm.deleteAll();
  
                          realm.close();
  
                      }
                  });
  
            }
      }
  </code></pre>