question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

c:geo crashes on resume in CacheDetailActivity

See original GitHub issue

Describe your problem!

c:geo crashes when CacheDetailActivity is resumed after low-memory situation.

How to reproduce?

  1. Open cache details
  2. Put c:geo into background
  3. Do something that uses lots of memory and causes the CacheDetailActivity to be suspended
  4. Switch back to c:geo

Actual result after these steps?

c:geo crashes with

12-04 19:13:52.760  8835  8835 W cgeo    : [main] UncaughtException
12-04 19:13:52.760  8835  8835 W cgeo    : java.lang.RuntimeException: Unable to start activity ComponentInfo{cgeo.geocaching/cgeo.geocaching.CacheDetailActivity}: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.ScrollView$SavedState
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2684)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2751)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.ActivityThread.-wrap12(ActivityThread.java)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.os.Handler.dispatchMessage(Handler.java:102)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.os.Looper.loop(Looper.java:154)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.ActivityThread.main(ActivityThread.java:6186)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at java.lang.reflect.Method.invoke(Native Method)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
12-04 19:13:52.760  8835  8835 W cgeo    : Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.ScrollView$SavedState
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.widget.ScrollView.onRestoreInstanceState(ScrollView.java:1832)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.view.View.dispatchRestoreInstanceState(View.java:15755)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3231)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.view.View.restoreHierarchyState(View.java:15733)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.Fragment.restoreViewState(Fragment.java:639)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.Fragment.restoreViewState(Fragment.java:3010)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:3001)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:580)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:285)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at cgeo.geocaching.activity.AbstractActivity.onStart(AbstractActivity.java:305)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1249)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.Activity.performStart(Activity.java:6701)
12-04 19:13:52.760  8835  8835 W cgeo    : 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2647)

Expected result after these steps?

No crash.

Reproducible

Yes

c:geo Version

2021.12.04-NB-3b6e977

System information

No response

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fm-syscommented, Dec 11, 2021

Just a side note: This can easily be reproduced by modifying the background limit in the system developer options…

Screenshot_20211211_142712_com android settings_copy_270x585

0reactions
eddiemuccommented, Dec 11, 2021

…and PR #12298 will do same thing for bottom navigation (targeted to master since bottom navigation is not yet on release)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash when opening cache details · Issue #5766 · cgeo/cgeo · GitHub
From support mail with permission to post it here: Hi, I'm for years on the nightly version, but this season I am not...
Read more >
Resume from sleep crash - Microsoft Community
My PC crashes sometimes when attempting to resume from sleep and just wondered if anyone could please help me find the cause of...
Read more >
Application Crashes when resuming the app - Stack Overflow
Camera is being used after Camera.release() was called. So, looking at the activity lifecycle, you need to open the camera in onStart() or ......
Read more >
How to Build a Better Resume (hint: send a pitch) - Crash
Build a better resume by not sending one at all. Stand out with creativity and humanization. Don't wait for permission.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found