首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Google玩inapp

Google玩inapp
EN

Stack Overflow用户
提问于 2012-10-10 08:57:41
回答 1查看 153关注 0票数 0

我已经实现了google play successfuly....and它的工作fine.....but,当我在关闭using...and之后关闭应用程序时,在关闭application...error几分钟后,给出了“应用程序停止了UNEXPEXTEDLY".....in日志猫,这表明错误在BillingService.java中。

10-10 13:38:38.739: E/AndroidRuntime(3586):由: java.lang.NullPointerException引起的

10-10 13:38:38.739: E/AndroidRuntime(3586):at .BillingService.handleCommand(BillingService.java:372)

10-10 13:38:38.739: E/AndroidRuntime(3586):at .BillingService.onStart(BillingService.java:362)

10-10 13:38:38.739: E/AndroidRuntime(3586):at android.app.Service.onStartCommand(Service.java:438)

我的密码是..。

代码语言:javascript
运行
复制
public void onStart(Intent intent, int startId) {

    handleCommand(intent, startId);------>362
}

public void handleCommand(Intent intent, int startId) {
    String action = intent.getAction();------>line 732
    if (Consts.DEBUG) {
        Log.i(TAG, "handleCommand() action: " + action);
    }

}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-10-10 09:07:37

我认为你必须完全退出应用程序。退出应用程序后,请检查任务管理器,如果任务管理器仍在运行的应用程序部分中,则必须结束该进程。

您可以检查以下代码:

代码语言:javascript
运行
复制
// This you have to insert inside the exit button click event
    Intent intent = new Intent(Intent.ACTION_MAIN);
                    intent.addCategory(Intent.CATEGORY_HOME);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(intent);
                    onQuitPressed(); 

//This is the onQuitPressed method

//to remove application from task manager
    public void onQuitPressed() {

        int pid = android.os.Process.myPid();
        android.os.Process.killProcess(pid);
    }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12815592

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档