title: Adding Google Play Login To Surface View
body: <p>I've read documentation and any guides only explain, how to set it up on an activity. I've tried including:</p>
  
  <pre><code>apiClient = new GoogleApiClient.Builder(this)
          .addApi(Games.API)
          .addScope(Games.SCOPE_GAMES)
          .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
      @Override
      public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
          Log.e(TAG, "Could not connect to Play games services");
          finish();
      }
  }).build();
  </code></pre>
  
  <p>(example code)</p>
  
  <p>Into my <code>oncreate</code> method in my main activity, But as the <code>main activity</code> is nothing more than just the loading platform for my surfaceview it doesn't work:</p>
  
  <p><strong>Main Activity code:</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          // fullscreen
          this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
          // Set No Title
  
          this.setContentView(new GameSurface(this));
      }
  
   }
  </code></pre>
  
  <p>I've tried putting it into my <code>gamesurface</code> class context but I cant use <code>getString</code> to post the scores to the high scores I've made in my developer console.</p>
  
  <p>Has anyone managed to do this doing it with just surfaceview? I thought about having an method to open another class and have that do the login, but how would I push the scores to leader board?</p>
  
  <p>How do I go about even viewing the leader board? <code>startActivityForResult</code> doesn't work.</p>
  
  <p><strong>BASICALLY</strong>
  What I want to achieve is have the login automatically happen when game is opened. Then an alternative to <code>getString</code> and open the leader boards. Any suggestions would be appreciated. I've been on this for a while.  </p>