Android应用程式内计费。当注销ResponseHandler所? [英] Android in-app-billing. When to unregister the ResponseHandler?

查看:158
本文介绍了Android应用程式内计费。当注销ResponseHandler所?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们实现应用内结算一年前与以下从文档样本$​​ C $ C没有问题。几个星期前,我们注意到了有关没有得到他们的项目的用户投诉。在调试code,我们发现下面的句子是问题的根源:

We implemented In-app Billing one year ago with no problems following the sample code from the documentation. Some weeks ago we noticed users complaints about not getting their items. While debugging the code we found that the following sentence was the root of the problem:

/**
 * Called when this activity is no longer visible.
 */
@Override
protected void onStop() {
    super.onStop();
    ResponseHandler.unregister(mDungeonsPurchaseObserver);
}

在我的三星Galaxy S设备出现Market屏幕时被调用这个方法,清除观察者和中断整个电路。我们已移动调用的OnDestroy 方法,而不是它现在的工作确定。

On my Samsung Galaxy S device this method is being called when the Market screen appears, clearing the observer and interrupting the overall circuit. We've moved the call to the OnDestroy method instead and it's working ok now.

这是处理问题的正确方法是什么?有没有人经历过这个?

Is this the correct way to handle the problem? Has anyone experienced this?

推荐答案

我面临同样的问题。我实现了对ResponseHandler所队列:如果观察者是空的,我把队列中的信息;一旦观察员加入,我把它用从队列中的信息。它使我的应用程序意识,它似乎是工作的罚款。

I was facing the same problem. I've implemented a queue on ResponseHandler: if the observer is null, I put the information on the queue; as soon an observer is added, I call it using the information from the queue. It makes sense in my application and it seems to be working fine.

我不知道,如果投入的onDestroy是一个好主意,因为这是没有意义的更新是不可见的活动的界面。

I do not know if putting in onDestroy is a good idea, because it makes no sense to update the interface of an Activity that is not visible.

您与您的解决方案遇到了什么问题?

Are you experiencing any problem with your solution?

这篇关于Android应用程式内计费。当注销ResponseHandler所?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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