Gen*_*nik 5 android android-billing
我正在使用Dungeons应用程序示例,我正在使用该示例中提供的BillingService类.
我正在使用Java 6和@override为我工作,但我在BillingService.java中的这两个方法得到了编译错误:
/**
* This is called when we are connected to the MarketBillingService.
* This runs in the main UI thread.
*/
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
if (Consts.DEBUG) {
Log.d(TAG, "Billing service connected");
}
mService = IMarketBillingService.Stub.asInterface(service);
runPendingRequests();
}
/**
* This is called when we are disconnected from the MarketBillingService.
*/
@Override
public void onServiceDisconnected(ComponentName name) {
Log.w(TAG, "Billing service disconnected");
mService = null;
}
Run Code Online (Sandbox Code Playgroud)
有人会帮我理解为什么会这样吗?
谢谢!
我认为你应该简单地从这两个方法中删除 @Override 装饰器。我正在使用 Google BillingService 类,这是我的方法:
public void onServiceConnected(ComponentName name, IBinder service)
{
mService = IMarketBillingService.Stub.asInterface(service);
runPendingRequests();
}
Run Code Online (Sandbox Code Playgroud)
您正在实现一个接口,而不是使用抽象方法扩展一个类。
| 归档时间: |
|
| 查看次数: |
1457 次 |
| 最近记录: |