android billing inApp / subscription无法找到明确的活动ProxyBillingActivity

时间:2018-07-18 03:21:47

标签: android in-app-purchase recurring-billing android-billing

我想实现订阅计费功能,但是当我调用launchBillingFlow方法时,却出现了这样的错误

  

android.content.ActivityNotFoundException:无法找到显式活动类{com.calendargb / com.android.billingclient.api.ProxyBillingActivity};您是否在AndroidManifest.xml中声明了此活动

这是我的样品

  BillingFlowParams purchaseParams = BillingFlowParams.newBuilder()
                    .setSku(skuId).setType(billingType).setOldSku(oldSku).build();
  mBillingClient.launchBillingFlow(mActivity, purchaseParams);

我应该在清单文件中声明显式ProxyBillingActivity吗?预先感谢!

1 个答案:

答案 0 :(得分:3)

您应该在清单文件中声明ProxyBillingActivity,如下所示:

<activity
   android:name="com.android.billingclient.api.ProxyBillingActivity"
   android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
   android:theme="@android:style/Theme.Translucent.NoTitleBar" />