意图无法解决

时间:2012-02-01 10:27:00

标签: android in-app-purchase in-app-billing

在实施结算时不断出现此错误。发生了什么事?

01-30 22:33:31.600: E/Finsky(25902): [1] IntentUtils.createIntentForReceiver: Could not find receiver for com.example.game.android
01-30 22:33:31.610: D/Finsky(25902): [1] MarketBillingService.sendResponseCode: Response RESULT_USER_CANCELED cannot be delivered to com.example.game.android. Intent does not resolve.

清单:

        ...
        <activity android:name="com.paypal.android.MEP.PayPalActivity"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar"
                  android:configChanges="keyboardHidden|orientation"/>
</application>
    <uses-permission android:name="com.android.vending.BILLING" />

    <service android:name=".api.billing.BillingService" />

<receiver android:name=".api.billing.BillingReceiver">
  <intent-filter>
    <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
    <action android:name="com.android.vending.billing.RESPONSE_CODE" />
    <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
  </intent-filter>
</receiver>

2 个答案:

答案 0 :(得分:1)

服务和接收者需要在应用程序标签中!

        ...
        <activity android:name="com.paypal.android.MEP.PayPalActivity"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar"
                  android:configChanges="keyboardHidden|orientation"/>
        <service android:name=".api.billing.BillingService" />

        <receiver android:name=".api.billing.BillingReceiver">
            <intent-filter>
                <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
                <action android:name="com.android.vending.billing.RESPONSE_CODE" />
                <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
            </intent-filter>
        </receiver>
    </application>
    <uses-permission android:name="com.android.vending.BILLING" />

答案 1 :(得分:1)

我有同样的问题,但是有一个不同的解决方案:我忘了包含一个&lt; intent-filter&gt;在我的&lt;接收器&gt;标签。它看起来像这样:

    <receiver android:name="com.blah.blah.blah.MessageReceiver">
     <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
     <action android:name="com.android.vending.billing.RESPONSE_CODE" />
     <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />                 
    </receiver>

故事的道德:仔细检查你的清单!