Skip to content

Instantly share code, notes, and snippets.

@peter-tackage
Created April 17, 2020 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peter-tackage/d28e7fc4b8fc4b52b77ed57ea34464b7 to your computer and use it in GitHub Desktop.
Save peter-tackage/d28e7fc4b8fc4b52b77ed57ea34464b7 to your computer and use it in GitHub Desktop.
Simulates teardown of Android ViewModel
fun ViewModel.tearDown() {
ViewModel::class.java.getDeclaredMethod("clear")
.apply { isAccessible = true }(this)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment