Change Dialog 's getWindow() to NonNull
Proposed Changes
getWindow()is NonNull ,mWindowis initialized during construction and has not been modified since then.
Testing
Test: override getWindow() in subclass of dialog,no problem.
The place to fix this, if it indeed is worth changing, would be in the framework, not some arbitrary subclass. But keep in mind that the nullability of these methods models the entire history of behavior–not just the current behavior.
The place to fix this, if it indeed is worth changing, would be in the framework, not some arbitrary subclass. But keep in mind that the nullability of these methods models the entire history of behavior–not just the current behavior.
@JakeWharton yes,this problem originates from framework, but it is impossible to be null.
I also submitted a patch for framework. https://android-review.googlesource.com/c/platform/frameworks/base/+/3428320