Starting with API 26, findViewById
uses inference for its return type, so you no longer have to cast.
Old definition:
View findViewById(int id)
New definition:
<T extends View> T findViewById(int id)
So if your compileSdk
is at least 26, it means that you can make use of this :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…