Skip to content

Instantly share code, notes, and snippets.

@tcw165
Last active January 6, 2017 05:14
Show Gist options
  • Save tcw165/2d8fef63c547957fe742f53b11f67507 to your computer and use it in GitHub Desktop.
Save tcw165/2d8fef63c547957fe742f53b11f67507 to your computer and use it in GitHub Desktop.
// Example 1, from an android.app.Activity:
// Use the startActivityForResult(Intent, int) and subscribe
// the result in onActivityResult(int, int, Intent).
startActivityForResult(
new Intent(this, IapDelegateActivity.class)
.putExtra(IapDelegateActivity.PARAMS_SKU, "sku")
.putExtra(IapDelegateActivity.PARAMS_SKU_PRICE, 1.99f));
// Example 2, from a android.app.Service:
// Use the startActivity(Intent) and subscribe the result in
// android.content.BroadcastReceiver.onReceive(Context, Intent).
startActivity(
new Intent(this, IapDelegateActivity.class)
.putExtra(IapDelegateActivity.PARAMS_SKU, "sku")
.putExtra(IapDelegateActivity.PARAMS_SKU_PRICE, 1.99f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment