Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 24
    I would say, this is the most important answer after an accepted one. Commented Mar 31, 2017 at 8:21
  • 8
    I would say that the existence of ContextWrapper is one of the worst decisions ever made by developers of Android framework. When they realized that they created an entire family of God Objects, instead of doing the right thing and refactoring the code toward Single Responsibility, they added an ugly hack that allowed to change Context behavior by deepening the inheritance tree. Bad software engineering at its ugliest. As for us, developers, IMHO no one should ever use getBaseContext() or ContextWrapper. If you do - it is a huge "code smell". Commented Nov 23, 2017 at 16:53
  • I'd like to see the complete CustomToast code. THANKS:))) Commented Sep 29, 2019 at 4:34
  • 1
    Thank you for this answer, I was not aware that ContextWrapper was to be used like this!! I always thought it was something internal from the Android Team. In my sense, this is the expected Answer. T H A N K S !!! Commented Jul 2, 2020 at 17:27