当我可以在我的模拟器中运行我的应用程序计费程序时,它显示无法绑定市场计费服务。
@Override
public void onCreate() {
super.onCreate();
Log.i(TAG, "Service starting with onCreate");
try {
boolean bindResult = bindService(new Intent("com.android.vending.billing.MarketBillingService.BIND"), this, Context.BIND_AUTO_CREATE);
if(bindResult){
Log.i(TAG,"Market Billing Service Successfully Bound");
} else {
Log.e(TAG,"Market Billing Service could not be bound.");
//TODO stop user continuing
}
} catch (SecurityException e){
Log.e(TAG,"Market Billing Service could not be bound. SecurityException: "+e);
//TODO stop user continuing
}
}
这意味着bindService不返回真值。
我究竟做错了什么?