我正在努力添加应用内计费并使用此官方文档
我在这个部分Binding to IInAppBillingService
这是我的代码:
public class CommunityActivity extends BaseActivity implements ServiceConnection
{
ArrayAdapter<ChatMessage> adapter;
Dialog dialog;
ArrayList<ChatMessage> chat = new ArrayList <ChatMessage>( );
IInAppBillingService mService;
ServiceConnection mServiceConn = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName name) {
mService = null;
}
@Override
public void onServiceConnected(ComponentName name,
IBinder service) {
mService = IInAppBillingService.Stub.asInterface(service);
}
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
FlurryAgent.onStartSession(this, "8CA5LTZ5M73EG8R35SXG");
setContentView(R.layout.community);
bindService(new
Intent("com.android.vending.billing.InAppBillingService.BIND"),
mServiceConn, Context.BIND_AUTO_CREATE);
但是我得到编译错误,说我必须实现 onServiceConnected 和 onServiceDisconnected 方法。但我认为我已经以示例建议的方式添加了它们。
我在这里哪里做错了?谢谢!