What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

Changing screen orientation (rotating device) while questions are still loading (progressbar still showing) will crash the app.

Here is the stack trace.

10-31 20:59:44.756: E/AndroidRuntime(25383): FATAL EXCEPTION: main
10-31 20:59:44.756: E/AndroidRuntime(25383): java.lang.NullPointerException: [v0.1.58] 
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.stackexchange.marvin.ui.common.MarvinFragment.updateActionBar(MarvinFragment.java:81)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.stackexchange.marvin.ui.SingleSiteFragment.access$000(SingleSiteFragment.java:37)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.stackexchange.marvin.ui.SingleSiteFragment$SingleSiteListResult.onHandled(SingleSiteFragment.java:260)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.stackexchange.marvin.ui.common.MarvinListOfThingsFragment$GetDataTask.onPostExecute(MarvinListOfThingsFragment.java:281)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.stackexchange.marvin.ui.common.MarvinListOfThingsFragment$GetDataTask.onPostExecute(MarvinListOfThingsFragment.java:194)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at android.os.AsyncTask.finish(AsyncTask.java:631)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at android.os.AsyncTask.access$600(AsyncTask.java:177)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at android.os.Handler.dispatchMessage(Handler.java:99)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at android.os.Looper.loop(Looper.java:137)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at android.app.ActivityThread.main(ActivityThread.java:5328)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at java.lang.reflect.Method.invokeNative(Native Method)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at java.lang.reflect.Method.invoke(Method.java:511)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
10-31 20:59:44.756: E/AndroidRuntime(25383):    at dalvik.system.NativeStart.main(Native Method)

Edit: This also happens when you press the back button while content is still loading.

So basically the activity gets destroyed or MarvinFragment gets detached from the activity before GetDataTask.onPostExecute() gets called / finishes.

And in onPostExecute() you're updating the actionbar, so you're probably calling getSherlockActivity().getSupportActionBar().

getSherlockActivity() will return null in this case, hence the NullPointerException.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Fixed in version 0.1.61 coming out later tonight. I also apologize to any of my coworkers who saw me trying to be really quick at rotating my phone around like a fool.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .