2012-10-10 5 views
0

Google Play successfuly ....를 구현했으며 작동 중 ... ...하지만 사용 후 내 애플리케이션을 닫으면 ... 애플리케이션을 종료 한 후 몇 분이 지나면 오류가 발생합니다. "응용 프로그램이 UNEXPEXTEDLY 중지되었습니다."..... 오류 메시지가 BillingService.java에 있습니다.Google inapp

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) android.app.Service.onStartCommand (Service.java:438)에서

이고 내 코드는 ....

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); 
    } 

} 

답변

2

나는 응용 프로그램을 독점적으로 종료해야한다고 생각합니다. 응용 프로그램을 종료 한 후 작업 관리자가 실행중인 응용 프로그램 섹션에 계속 등록되어 있으면 프로세스를 종료해야합니다.

// 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); 
    } 
:

다음과 같은 코드를 확인하실 수 있습니다