Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BillingClient cannot be applied

I'm trying to implement in app purchases in my app, there is a nice tutorial from Google themselves. However, on the first line of code I already get an error message...

When trying to use this code:

mBillingClient = BillingClient.newBuilder(mActivity).setListener(this).build();

Which I implement as:

`mBillingClient=BillingClient.newBuilder(this).setListener(this).build()`

I get error: incompatible types: MyActivity cannot be converted to PurchasesUpdatedListener

like image 331
B.Cakir Avatar asked Jul 10 '18 10:07

B.Cakir


1 Answers

Your Activity must implements PurchasesUpdatedListener like :

public class YourActivity extends Activity implements PurchasesUpdatedListener {
    ...
}
like image 140
Bubu Avatar answered Nov 14 '22 00:11

Bubu