Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Crash After Redemption on Activity Paused #2

Open
2 tasks
chrispypatt opened this issue Jan 14, 2019 · 0 comments
Open
2 tasks

Crash After Redemption on Activity Paused #2

chrispypatt opened this issue Jan 14, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@chrispypatt
Copy link
Member

After redeeming a deal on the viewDealFragment, an issue either due to the location callback or timer is causes a delayed crash when moving forward to the ViewVendorFragment. This is because their callbacks are still active and will cause an IllegalStateException when called. This issue was initially more widespread, including crashes when returning to the tabbed activity. After cancelling the timer and location callbacks in onDestroy(), this no longer occurs when returning to the tab view.

The first attempt to solve the issue for the ViewVendorFragment was to cancel both in onPause() as well. The issue so far with this solution is that upon returning to the ViewDealFragment, an exception is called reporting that the timer has already been cancelled.

Two avenues to pursue this further:

  • Location is no longer needed after the deal has been redeemed. Don't initialize location services if the deal has been redeemed AND cancel the service after a deal has been redeemed.

  • Use onPause to remove the timer and then make sure to restart it with the correct timing info in onResume.

@chrispypatt chrispypatt added the bug Something isn't working label Jan 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant