3

我正在尝试启动 com.android.vending.billing.IMarketBillingService 服务,我收到了这条消息。我正在使用模拟器 Android 2.3.3 - API 级别 10。

03-23 15:04:53.535: WARN/ActivityManager(61): Unable to start service Intent { act=com.android.vending.billing.IMarketBillingService }: not found
03-23 15:04:53.535: ERROR/BillingService(416): Could not bind to service.

代码:

private boolean bindToMarketBillingService() {
    try {
        if (Consts.DEBUG) {
            Log.i(TAG, "binding to Market billing service");
        }
        boolean bindResult = bindService(
                new Intent(IMarketBillingService.class.getName()),
                this,  
                Context.BIND_AUTO_CREATE);

        if (bindResult) {
            return true;
        } else {
            Log.e(TAG, "Could not bind to service.");
        }
    } catch (SecurityException e) {
        Log.e(TAG, "Security exception: " + e);
    }
    return false;
}
4

1 回答 1

1

您是否已将 IMarketBillingService.aidl 添加到您的包中,然后重建您的项目?

如果你有这个尝试:

boolean bindResult = bindService(new Intent("com.android.vending.billing.MarketBillingService.BIND"), this, Context.BIND_AUTO_CREATE);

为我工作

于 2011-03-25T23:18:28.313 回答