应用内结算交换活动 [英] In-App Billing switching activities

查看:142
本文介绍了应用内结算交换活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

啊的应用内结算的问题永远不会结束! ^ ^我拥有一切工作正常,显示了在应用程序内购买的交易页面。如果我完成它返回我到我的应用程序,大约10秒钟后,它会验证购买我收到该项目的购买。

Ahh the in-app billing problems never end! ^.^ I have everything working properly to show the transaction page for the in-app purchase. If I complete the purchase it returns me to my application and after about 10 seconds it verifies the purchase and I receive the item.

在另一方面,如果余preSS的后退按钮返回到应用程序并切换到另一个活动之后它从未处理交易。即使我回到了在应用程序内结算的活动我从来没有收到我购买的物品,如购买已经完全忘记了,如果你调用finish()。

On the other hand, if I press the back button after returning to the application and switch to another activity it never processes the transaction. Even if I return to the in-app billing activity I never receive my purchased item, like the purchase has been completely forgotten about if you call finish().

我能做些什么,以便它会完成交易,使该项目时,我回到了应用内结算活动或处理该交易,并给出了购买物品的任何地方,我在我的内部应用程序?

What can I do so that it either completes the transaction and gives the item when I return to the in-app billing activity or processes the transaction and gives the purchased item anywhere that I am at within my application?

推荐答案

收到通知由广播接收机,它独立于你的活动处理。你如何处理的通知是由你。在默认的实现必须通过活动实现的 PurchaseObserver 接口。你可以有多个活动,实现它并注册相应调用。或者,你可以有相关的code在基地的活动,让所有的活动都是 PurchaseObserver 的(如果你有很多的活动,可能是不实际的) 。

Receiving the notification is handled by a broadcast receiver which is independent from your activities. How you handle the notification is up to you. In the default implementation you have a PurchaseObserver interface implemented by an Activity. You can have multiple activities implement it and register to be called accordingly. Or, you can have related code in a base activity, so that all your activities are PurchaseObserver's (might not be practical if you have a lot of activities).

这篇关于应用内结算交换活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆