静的メイン変数(アプリの計算機)を格納するメインクラス(アプリケーションを拡張)があります。アプリを一時停止した後(ホームボタンまたは通話)
06-21 00:43:14.916: E/AndroidRuntime(26676): FATAL EXCEPTION: AsyncTask #1
06-21 00:43:14.916: E/AndroidRuntime(26676): java.lang.RuntimeException: An error occured while executing doInBackground()
06-21 00:43:14.916: E/AndroidRuntime(26676): at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-21 00:43:14.916: E/AndroidRuntime(26676): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.lang.Thread.run(Thread.java:856)
06-21 00:43:14.916: E/AndroidRuntime(26676): Caused by: java.lang.NullPointerException
06-21 00:43:14.916: E/AndroidRuntime(26676): at com.AMain$CalcTask.doInBackground(AMain.java:106)
06-21 00:43:14.916: E/AndroidRuntime(26676): at ru.ps.horoscope.AMain$CalcTask.doInBackground(AMain.java:1)
06-21 00:43:14.916: E/AndroidRuntime(26676): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-21 00:43:14.916: E/AndroidRuntime(26676): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-21 00:43:14.916: E/AndroidRuntime(26676): ... 5 more
106 文字列:if (!_.calc.Calculated) CALCULATE_();
_ extends Application
修正方法は?
@Override
protected Void doInBackground(Void... arg0) {
// TODO Auto-generated method stub
if (!_.calc.Calculated) CALCULATE_();
return null;
}