2011-03-23 253 views
3

我試圖啓動com.android.vending.billing.IMarketBillingService服務,並收到此消息。我使用模擬器的Android 2.3.3 - API級別10無法啓動服務com.android.vending.billing.IMarketBillingService

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; 
} 

回答

1

你添加IMarketBillingService.aidl你的包,然後重建項目?

如果你有嘗試這個辦法:

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

工作對我來說