Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing logged rides crashes app #30

Closed
kwatkins opened this issue Nov 29, 2017 · 4 comments
Closed

Accessing logged rides crashes app #30

kwatkins opened this issue Nov 29, 2017 · 4 comments
Assignees
Labels

Comments

@kwatkins
Copy link
Collaborator

kwatkins commented Nov 29, 2017

Testing out the database updates, sometimes it opens the logged ride, and as soon as I try and move the map I get a crash.

The exception that gets thrown:

11-29 10:08:03.337 9197 9268 E AndroidRuntime: Process: net.kwatts.powtools, PID: 9197 11-29 10:08:03.337 9197 9268 E AndroidRuntime: at net.kwatts.powtools.MapActivity.setupChart(MapActivity.java:250) 11-29 10:08:03.337 9197 9268 E AndroidRuntime: at net.kwatts.powtools.MapActivity.lambda$onCreate$0$MapActivity(MapActivity.java:89) 11-29 10:08:03.337 9197 9268 E AndroidRuntime: at net.kwatts.powtools.MapActivity$$Lambda$0.run(Unknown Source) 11-29 10:08:03.337 9197 9268 E AndroidRuntime: at net.kwatts.powtools.App.lambda$dbExecute$25$App(App.java:58) 11-29 10:08:03.337 9197 9268 E AndroidRuntime: at net.kwatts.powtools.App$$Lambda$0.run(Unknown Source) 11-29 10:08:03.349 1149 3228 W ActivityManager: Force finishing activity net.kwatts.powtools/.MapActivity 11-29 10:13:01.039 1149 3228 W ActivityManager: Force finishing activity net.kwatts.powtools/.RidesListActivity 11-29 10:13:01.140 1149 3228 W ActivityManager: Force finishing activity net.kwatts.powtools/.MainActivity

And other times this:

11-29 10:21:54.650 11980 12343 E AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1 11-29 10:21:54.650 11980 12343 E AndroidRuntime: Process: net.kwatts.powtools, PID: 11980 11-29 10:21:54.650 11980 12343 E AndroidRuntime: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6892) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1048) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.requestLayout(View.java:19781) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.setBackgroundDrawable(View.java:18356) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.setBackground(View.java:18247) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at android.view.View.setBackgroundColor(View.java:18209) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at net.kwatts.powtools.MapActivity.setupChart(MapActivity.java:250) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at net.kwatts.powtools.MapActivity.lambda$onCreate$0$MapActivity(MapActivity.java:89) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at net.kwatts.powtools.MapActivity$$Lambda$0.run(Unknown Source) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at net.kwatts.powtools.App.lambda$dbExecute$25$App(App.java:58) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at net.kwatts.powtools.App$$Lambda$0.run(Unknown Source) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 11-29 10:21:54.650 11980 12343 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761) 11-29 10:21:54.654 1149 2453 W ActivityManager: Force finishing activity net.kwatts.powtools/.MapActivity

I'll dig into it deeper as well.

@ebabel
Copy link
Collaborator

ebabel commented Nov 29, 2017

I fixed that, it was because we needed to switch to the UI thread.
sha c27e7e6

@ebabel
Copy link
Collaborator

ebabel commented Nov 29, 2017

@kwatkins You weren't on that sha yet right?

@kwatkins
Copy link
Collaborator Author

Oh, no, I'll grab that. Yeah just found out that was the issue lineChart.invalidate() - you might want to add some exception handling in places, threading can be helll

@ebabel
Copy link
Collaborator

ebabel commented Nov 29, 2017

Thanks for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants