In my self-study of Android, I was never able to get ProgressBar by ProgressBar ID when I was training to use ProgressBar. Always quote "Type Mismatch:cannot convert from View to ProgressBar" error. Check code, no errors found. Two nights, none of them were checked out.
After searching the internet, I found it very rare to ask this question. And there is no detailed discussion of the source of the problem.
I'll discuss the issue in detail here.
I have never encountered such a problem when I was learning Corejava. It's in Android. The class name I built is ProgressBar, and then I want to get control ProgressBar. Everyone should see the mistake. ProgressBar is an existing class on Android, and the activity I build is also class. The class name is conflicting. The IDE tool does not automatically recognize whether to get my own activity or to get a control. So the error.
In Corejava, no one will build a "String" class, because this class is already in Java. But in Android, we thought we were building an activity, but the activity is still class, it's a special class that inherits the activity, and it still has to
Comply with rules that cannot be duplicated by class names.
This is the root of the error. The understanding of the activity is not thorough, resulting in an error.