Repository navigation
Android Nougat compatibility: onstart/onstop on MapView - #6830
Conversation
|
@tobrun, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bleege, @cammace and @ivovandongen to be potential reviewers. |
|
Target SDK set to Nougat has landed on master with #6390, this PR is ready for review. |
zugaldia
left a comment
There was a problem hiding this comment.
Per chat, let's also add a line to the CHANGELOG.md file stating that v.5.0.0 will target and support N.
|
@zugaldia updated |
|
@tobrun Thanks. Note that I haven't reviewed the rest yet, I'll let @ivovandongen do it per OP. |
| /** | ||
| * You must call this method from the parent's {@link Activity#onPause()} or {@link Fragment#onPause()}. | ||
| */ | ||
| @UiThread |
There was a problem hiding this comment.
Since we're doing a semver release anyway. Can't we remove this all together? Or at least deprecate it?
There was a problem hiding this comment.
I implemented this way to make sure users are correctly migrating from an older version. If a user doesn't implement the new onStart/onStop, they will not be able to receive any location updates. This is something that will go unnoticed during "migration" and will only show when you are trying to a location fix. I have no problem with removing this but I felt it was an improvement over the other possible UX here.

Closes #5910.
This PR makes the SDK compatible with Android Nougat by moving the location listener logic to the Activity onStart/onStop instead of onResume/onPause. This change is needed to support multiwindow feature introduced in Android nougat.
To make migration easier for users, I opted to implement an exception that is thrown when the newly introduced MapView#onStart or MapView#onStop isn't called. It's similar to SuperNotCalledException from the Android SDK. This will enforce Users to migrate to the new methods.
Review @ivovandongen