Last active
June 14, 2022 09:27
-
-
Save mazzouzi/33ab07c8bff5e1f34ef444f2ad13200f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun onError(errorMessage: String) { | |
/** | |
* Here we pass a copy of the context as a parameter to every functions | |
* of DialogUtilSolution singleton. | |
* Once the function returns, the copy is popped off the stack | |
* -> no memory leak ✅ | |
* Be careful, this code will still leak if the user changes configuration while | |
* the dialog is displayed because the dialog is not tied to the Activity's lifecycle upon | |
* recreation. Please check "solutionfinal" package for complete solution. | |
*/ | |
DialogUtilSolution.showError(this, "News", errorMessage) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment