summaryrefslogtreecommitdiffstats
path: root/docs/html/google/play/billing/billing_integrate.jd
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/google/play/billing/billing_integrate.jd')
-rwxr-xr-xdocs/html/google/play/billing/billing_integrate.jd17
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index 405c58a..3f6df92 100755
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -111,20 +111,21 @@ ServiceConnection mServiceConn = new ServiceConnection() {
<pre>
&#64;Override
public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- bindService(new
- Intent("com.android.vending.billing.InAppBillingService.BIND"),
- mServiceConn, Context.BIND_AUTO_CREATE);
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ bindService(new
+ Intent("com.android.vending.billing.InAppBillingService.BIND"),
+ mServiceConn, Context.BIND_AUTO_CREATE);
</pre>
<p>You can now use the mService reference to communicate with the Google Play service.</p>
<p class="note"><strong>Important:</strong> Remember to unbind from the In-app Billing service when you are done with your {@link android.app.Activity}. If you don’t unbind, the open service connection could cause your device’s performance to degrade. This example shows how to perform the unbind operation on a service connection to In-app Billing called {@code mServiceConn} by overriding the activity’s {@link android.app.Activity#onDestroy onDestroy} method.</p>
<pre>
&#64;Override
public void onDestroy() {
- if (mServiceConn != null) {
- unbindService(mServiceConn);
- }
+ super.onDestroy();
+ if (mServiceConn != null) {
+ unbindService(mServiceConn);
+ }
}
</pre>