itkach / aard2-android

Aard2 for Android, a simple dictionary app
GNU General Public License v3.0
464 stars 98 forks source link

App crashing when leaving article activity after a longer time #6

Closed nubenum closed 10 years ago

nubenum commented 10 years ago

When you revisit the article activity via the recents (probably also via the launcher) after a longer time and then go back to search for another article, the app crashes. This happens for me on Android Lollipop/Nexus 5, I don't know if this occurs also on other Android versions. This is especially the case if you're doing some CPU/RAM intensive tasks and then want to return to Aard, so I suppose that Android is killing the search/list activity in some way.

Apart from that, Aard2 is really great and I'm looking forward to the offline images.

Stack trace:

11-22 17:03:27.750  29943-29943/? W/UnimplementedWebViewApi﹕ Unimplemented WebView method onKeyDown called from: android.webkit.WebView.onKeyDown(WebView.java:2301)
11-22 17:03:27.899  29943-29943/? D/AndroidRuntime﹕ Shutting down VM
11-22 17:03:27.905  29943-29943/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: itkach.aard2, PID: 29943
    java.lang.RuntimeException: Unable to start activity ComponentInfo{itkach.aard2/itkach.aard2.MainActivity}: java.lang.IllegalStateException: Content view not yet created
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: java.lang.IllegalStateException: Content view not yet created
            at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
            at android.support.v4.app.ListFragment.setListShown(ListFragment.java:280)
            at android.support.v4.app.ListFragment.setListShown(ListFragment.java:258)
            at itkach.aard2.LookupFragment.setBusy(LookupFragment.java:147)
            at itkach.aard2.LookupFragment.onCreateOptionsMenu(LookupFragment.java:127)
            at android.support.v4.app.Fragment.performCreateOptionsMenu(Fragment.java:1586)
            at android.support.v4.app.FragmentManagerImpl.dispatchCreateOptionsMenu(FragmentManager.java:1973)
            at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:226)
            at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:548)
            at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:917)
            at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:258)
            at com.android.internal.policy.impl.PhoneWindow.doPendingInvalidatePanelMenu(PhoneWindow.java:891)
            at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2008)
            at android.app.Activity.onRestoreInstanceState(Activity.java:1022)
            at itkach.aard2.MainActivity.onRestoreInstanceState(MainActivity.java:82)
            at itkach.aard2.MainActivity.onCreate(MainActivity.java:74)
            at android.app.Activity.performCreate(Activity.java:5933)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
11-22 17:03:27.909     721-1263/? W/ActivityManager﹕ Force finishing activity itkach.aard2/.MainActivity
11-22 17:03:27.965     721-3303/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4
11-22 17:03:28.426      721-809/? W/ActivityManager﹕ Activity pause timeout for ActivityRecord{834a2ff u0 itkach.aard2/.MainActivity t843 f}
itkach commented 10 years ago

Thank you for the report. This doesn't seem to be happenning on Android 4.4. I'll investigate once I get Lollipop.

itkach commented 10 years ago

I think f9d1fb1a42a83baa07e9b0541280549f509bf1e2 should fix this, give it a try