Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

[testapp] fixup onSaveInstanceState usage #539

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Aug 25, 2020

This PR fixes up the usage of Activity#OnSaveInstanceState:

override fun onSaveInstanceState(outState: Bundle?, outPersistentState: PersistableBundle?) {
    super.onSaveInstanceState(outState, outPersistentState)
    outState?.let {
      mapView.onSaveInstanceState(it)
    }
  }

to

override fun onSaveInstanceState(outState: Bundle) {
  super.onSaveInstanceState(outState)
  mapView.onSaveInstanceState(outState)
}

Noticed that with targeting Android 11 (R), nullabity of the former method was corrected to onSaveInstanceState(outState: Bundle, outPersistentState: PersistableBundle) and was giving me compilation issues. I have chaged the code to use the default OnSaveInstanceState, there is not specific reason to use the former for our use-case.

@tobrun tobrun requested a review from a team August 25, 2020 08:54
@tobrun tobrun self-assigned this Aug 25, 2020
Copy link
Contributor

@Chaoba Chaoba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add onSaveInstanceState for all test Activities?

@tobrun tobrun mentioned this pull request Aug 25, 2020
@tobrun tobrun force-pushed the tvn-onsaveinstancestate branch from 20e387a to 25e8642 Compare August 25, 2020 17:07
@tobrun
Copy link
Member Author

tobrun commented Aug 26, 2020

Should we add onSaveInstanceState for all test Activities?

sure, but not a high priority for this repository if you ask me

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

Successfully merging this pull request may close these issues.

2 participants