title: GreenDao how to implement callbacks
body: <p>I have a trouble, i need to get event/callback when i try to write to database.
  I added greenDao lib to project, and i able to write/delete in db.
  But no idea how to get callback after some operation under db.</p>
  
  <p>In introduction to lib i read <em>"AsyncOperationListener for asynchronous callback when operations complete"</em>. 
  Used this tutorial:
  <a href="http://blog.surecase.eu/using-greendao-with-android-studio-ide/" rel="nofollow">http://blog.surecase.eu/using-greendao-with-android-studio-ide/</a></p>
  
  <p>Can anybody help me with this trouble?</p>
  
  <p><strong>UPD:</strong></p>
  
  <p>ok here we added some list in storage</p>
  
  <pre><code>getMyObjectDao().getSession().startAsyncSession().insertOrReplaceInTx(MyObject.class, list);
  </code></pre>
  
  <p>error here</p>
  
  <pre><code>List&lt;MyObject&gt; items = getBoxDao(c).getSession().startAsyncSession().loadAll(MyObject.class);
  </code></pre>
  
  <p>How can we asynchronously load data from db?</p>
  
  <p>Is this correct solution?</p>
  
  <pre><code>            @Override
              public void onAsyncOperationCompleted(AsyncOperation operation) {
                  String operationIs = null;
  
                  switch (operation.getType()) {
  
                      case LoadAll:
                  itemsList = BoxRepository.getAllBoxes(getApplicationContext());
  </code></pre>