我试图从AndroidPit.com获得一些授权代码,但我得到“无法启动服务意图”。基本上我的代码如下所示:为什么我会收到“无法启动服务意图”?
Intent licenseIntent = new Intent("de.androidpit.app.services.ILicenseService");
if (mContext.bindService(licenseIntent, this, Context.BIND_AUTO_CREATE))
{
// success
}
else
{
// failure (I get this all the time(
}
我试图通过ILicenseService类明确:
Intent licenseIntent = new Intent(mContext, de.androidpit.app.services.ILicenseService.class);
,但我仍然得到了同样的问题。
我设法让Android Market LVL库使用相同的代码工作,所以我不明白为什么它找不到“de.androidpit.app.services.ILicenseService”,但设法找到“com.android .vending.licensing.ILicensingService”。
我在这里找到的大多数答案都说你需要在AndroidManifest.xml文件中添加东西,但是对于“com.android.vending.licensing.ILicensingService”工作不需要任何东西,所以我想我应该'不需要任何东西“de.androidpit.app.services.ILicenseService”(它们都来自android.os.IInterface)。
在此先感谢。
您是否记得将该服务添加到清单中? – Bex 2011-06-03 12:17:07