title: null pointer exception error while mentioning realm query
body: <p>Error said :</p>
  
  <blockquote>
    <p>E/AndroidRuntime: FATAL EXCEPTION: main
       Process: myname.myapp, PID: 8504
       java.lang.RuntimeException: Unable to start activity >ComponentInfo{myname.myapp/myname.myapp.MainActivity}: >java.lang.NullPointerException: Attempt to invoke virtual method >'io.realm.RealmQuery io.realm.Realm.where(java.lang.Class)' on a null object >reference
    ...
    at myname.myapp.MainActivity.loadFoodlist(MainActivity.java:591)
    at myname.myapp.MainActivity.onCreate(MainActivity.java:91)</p>
  </blockquote>
  
  <p>My code :</p>
  
  <pre><code>#591 RealmQuery&lt;Food&gt; query = realm.where(Food.class);
  #91  foodList = loadFoodList(realm);
  </code></pre>