title: Fire event on AsyncTask finished
body: <p>My app has a login activity and it checks the credentials via an internet website.
  To do so, I (have to) use an AsyncTask class.
  When login is successful, a global variable is set to true.</p>
  
  <p>Because this is asynchronous, the activity won't wait for the result so I would like to add an event that is fired by the post-execute method of the AsyncTask class.
  Then a <code>listener</code> on the login activity will close itself and the main activity is visible.</p>
  
  <p>I would like to know if and how this is possible.
  I have tried some examples from other posts, but can't figure it out from those.</p>
  
  <p>I think I have to do the following:
  - create an <code>interface</code> in the <code>AsyncTask</code> class
  - from the <code>post_execute</code> method of that class, I raise the event, but how?
  - put a <code>listener</code> in the login activity, but how?</p>
  
  <p>any help is appreciated.</p>
  
  <p>Regards,
  Eric</p>