No need to cast the result of findViewById?
问题 Recently i found that AndroidStudio reminds me to remove some class cast. I remember that in the old time, we have to cast the result of findViewById, but now it\'s not necessary. The result of findViewById is still View, so i want to know why we don\'t need to cast the class? I can\'t find any documents mentioned that, can anyone find any document? 回答1: Starting with API 26, findViewById uses inference for its return type, so you no longer have to cast. Old definition: View findViewById(int