2012-01-16 2 views
1

하루에 몇 가지 오류가 발생했으며 어떤 일이 일어나고 있는지 잘 모르겠습니다.Android : 내 애플리케이션을 왜 상하게합니까?

자세한 정보가 필요하면 알려 주시기 바랍니다.

나는 무엇이든을위한 충분한 정보를주지 않았을 것입니다. 여기

내가 내 개발자 콘솔에서 얻을 오류입니다 :

java.lang.RuntimeException: Unable to destroy activity {com.Calculator.SalesTaxCalculator/com.Calculator.SalesTaxCalculator.Calculator}: java.lang.NullPointerException 
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3199) 
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3264) 
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3380) 
at android.app.ActivityThread.access$1600(ActivityThread.java:145) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1049) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:150) 
at android.app.ActivityThread.main(ActivityThread.java:4369) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:507) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:846) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.NullPointerException 
at android.content.ComponentName.<init>(ComponentName.java:75) 
at android.content.Intent.<init>(Intent.java:2920) 
at com.Calculator.SalesTaxCalculator.BillingHelper.stopService(BillingHelper.java:265) 
at com.Calculator.SalesTaxCalculator.Calculator.onDestroy(Calculator.java:302) 
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3181) 
... 12 more 

라인 (302)

라인 (301)과 저쪽 (이 해당 페이지에 코드의 마지막 세트입니다에서
protected void onDestroy() { 

.)

@Override 
protected void onDestroy() { 
    BillingHelper.stopService(); 
    super.onDestroy(); 

} 
} 

StopService 방법 충돌 보고서 중 하나에 넣어 사람

public static void stopService(){ 
       mContext.stopService(new Intent(mContext, BillingService.class)); 
       mService = null; 
       mContext = null; 
       mCompletedHandler = null; 
       Log.i(TAG, "Stopping Service"); 
     } 
} 

BillingHelper의 앱이조차 열리지 않습니다 것을 코멘트. 더 많은 정보는 공유 환경 설정을 사용하여 계산기에 숫자를 저장한다는 것입니다. 또한 인앱 결제 서비스를 사용하는 기부 버튼이 있습니다.

+1

Calculator.java:302 또한이 행을 게시하십시오. –

+1

붙여 넣기해야 할 최소한의 것들은 모든 액티비티의 detroy 코드입니다. 그리고 계산기 코드. 거기에 오류가있는 것으로 보입니다. – sebap123

+0

'BillingHelper.stopService()'에도 오류가있을 수 있습니다. – Vladimir

답변

2

변경하여 super.onDestroy()를 호출하십시오. 예를 들면 다음과 같습니다.

@Override 
protected void onDestroy() { 
    super.onDestroy(); 
    BillingHelper.stopService(); 
} 
+0

이것이 문제를 해결할 수 있는지 테스트 할 방법이 있습니까? 나는 그 사고가 무엇인지, 어떻게 다시 만들지 모르겠다. 나는 그 문제로 15,000 명 중 16 명 밖에 없다. –

+0

내 앱을 테스트 한 모든 기기가 앱과 작동합니다. 이 문제는 내 앱에 결제를 추가 할 때 시작되었습니다. –

+0

BillingHelper의 StopService 메소드에는 무엇이 있습니까? – waqaslam

관련 문제