Skip to content

Instantly share code, notes, and snippets.

@hitherejoe hitherejoe/apiclient.java Secret
Created Jun 30, 2016

Embed
What would you like to do?
@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
You can’t perform that action at this time.