Crash when activity is left when loading bus data
Closed this issue · 0 comments
michalbednarski commented
01-12 10:28:18.753 4124-4298/pl.edu.zut.mad.appwizut2 I/HttpConnect﹕ getPage
01-12 10:28:18.768 4124-4138/pl.edu.zut.mad.appwizut2 E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
Process: pl.edu.zut.mad.appwizut2, PID: 4124
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:375)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:370)
at pl.edu.zut.mad.appwizut2.utils.SharedPrefUtils.getSharedPreferences(SharedPrefUtils.java:27)
at pl.edu.zut.mad.appwizut2.utils.BusTimetable.parseDataFromLoader(BusTimetable.java:156)
at pl.edu.zut.mad.appwizut2.utils.BusTimetable.access$100(BusTimetable.java:34)
at pl.edu.zut.mad.appwizut2.utils.BusTimetable$2.foundData(BusTimetable.java:103)
at pl.edu.zut.mad.appwizut2.network.BusTimetableLoader$GetBusInfo.doInBackground(BusTimetableLoader.java:94)
at pl.edu.zut.mad.appwizut2.network.BusTimetableLoader$GetBusInfo.doInBackground(BusTimetableLoader.java:71)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)