You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
or like this in java in your callback system:
offlineRegion.delete(object : OfflineRegion.OfflineRegionDeleteCallback {
override fun onDelete() {
...
}
override fun onError(error: String?) {
.... // error could now be MalformedOfflineRegionException
}
})
Actual behavior
App crashes and we can't catch c++ exception. Obvious workaround is to save to a variable (downloadStatus in my example) a state that knows when the map is being deleted and prevents deleting it again, but I still feel mapbox should throw Java exception so we can catch it.
The text was updated successfully, but these errors were encountered:
prompteus
changed the title
Android crash when canceling twice downloading offline map
Android crash when canceling downloading offline map twice
Aug 25, 2017
Android
Mapbox SDK version: 5.1.3
(I use Kotlin but I hope you get the idea)
Steps to trigger behavior
My code looks like this:
When
stopDownloading()
is called twice very quickly, so I call offline region delete method when it is already being deleted it throws C++ exception:Expected behavior
Mapbox should catch C++ exception and throw Java exception so we can catch it inside of Android java code. somehow like this (in my kotlin code):
or like this in java in your callback system:
offlineRegion.delete(object : OfflineRegion.OfflineRegionDeleteCallback {
override fun onDelete() {
...
}
Actual behavior
App crashes and we can't catch c++ exception. Obvious workaround is to save to a variable (downloadStatus in my example) a state that knows when the map is being deleted and prevents deleting it again, but I still feel mapbox should throw Java exception so we can catch it.
The text was updated successfully, but these errors were encountered: