title: Passing events from a non-activity class to an Activity class
body: <p>I have an activity class A for the layout and a non-activity class B for Location Request; the class B triggers some events like onConnectionSuspended and i want to get these back in the classe A.  How can i do that ?<br>
  Thank you for the previous answers, i worked on it but i add some details. </p>
  
  <p>I want to separate the Activity code from the GoogleApi.Connection code. To do that i made a non-activity class (maybe a service is better ?) with Connection code (see the structure code below).</p>
  
  <p>1) Is it a good idea ?<br>
  2) If it is not, what is better to do (maybe put all in the same Activity ?) ?<br>
  3) If it is yes, i don't think that i can put some "Toast" in the connections events of my non-activity code so how can i get back the connections events in the Activity to display some messages ?<br>
  Thank you for the answers</p>
  
  <pre><code>import android.os.Bundle;
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.api.GoogleApiClient;
  
  public class SATlocation implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{
  
      @Override
      public void onConnected(Bundle bundle) {
  
      }
  
      @Override
      public void onConnectionSuspended(int i) {
  
      }
  
      @Override
      public void onConnectionFailed(ConnectionResult connectionResult) {
  
      }
  }
  </code></pre>