Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created June 30, 2016 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitherejoe/b0c26ac06a0189fe178840a6b1c3687b to your computer and use it in GitHub Desktop.
Save hitherejoe/b0c26ac06a0189fe178840a6b1c3687b to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
googleApiClient = createGoogleApiClient();
}
private GoogleApiClient createGoogleApiClient() {
return new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Wallet.API, new Wallet.WalletOptions.Builder()
.setEnvironment(WalletConstants.ENVIRONMENT_PRODUCTION)
.setTheme(WalletConstants.THEME_HOLO_DARK).build()).build();
}
protected void onStart(){
super.onStart();
googleApiClient.connect();
}
protected void onStop() {
googleApiClient.disconnect();
super.onStop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment