App version: 1.0.31/1.0.35/1.0.52
Device: Nexus 7
Problem: When you rotate the screen while passing a comment the app will crash. The comment is still posted, even though the app does crash.
LOGCAT:
04-27 01:59:20.562 E/AndroidRuntime(17551): FATAL EXCEPTION: main
04-27 01:59:20.562 E/AndroidRuntime(17551): java.lang.IllegalArgumentException: View not attached to window manager
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:406)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:308)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:79)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.app.Dialog.dismissDialog(Dialog.java:323)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.app.Dialog.dismiss(Dialog.java:306)
04-27 01:59:20.562 E/AndroidRuntime(17551): at com.stackexchange.marvin.core.OperationThatCanFail$1.onPostExecute(OperationThatCanFail.java:81)
04-27 01:59:20.562 E/AndroidRuntime(17551): at com.stackexchange.marvin.core.OperationThatCanFail$1.onPostExecute(OperationThatCanFail.java:67)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.os.AsyncTask.finish(AsyncTask.java:631)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.os.AsyncTask.access$600(AsyncTask.java:177)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.os.Handler.dispatchMessage(Handler.java:99)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.os.Looper.loop(Looper.java:137)
04-27 01:59:20.562 E/AndroidRuntime(17551): at android.app.ActivityThread.main(ActivityThread.java:5103)
04-27 01:59:20.562 E/AndroidRuntime(17551): at java.lang.reflect.Method.invokeNative(Native Method)
04-27 01:59:20.562 E/AndroidRuntime(17551): at java.lang.reflect.Method.invoke(Method.java:525)
04-27 01:59:20.562 E/AndroidRuntime(17551): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
04-27 01:59:20.562 E/AndroidRuntime(17551): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-27 01:59:20.562 E/AndroidRuntime(17551): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
04-27 01:59:20.562 E/AndroidRuntime(17551): at dalvik.system.NativeStart.main(Native Method)
at com.stackexchange.marvin.core.OperationThatCanFail$1.onPostExecute(OperationThatCanFail.java:81)
rofl, I think they meant for the app to crash on that. ;) – hichris123 Apr 27 '14 at 1:40onPostExecute
, it must be usingAsyncTask
, and yes, this must be handled carefully if there is configuration change (e.g. orientation change) since the app might lose the reference to the task and crash. – Meta Andrew T. Dec 21 '14 at 15:30