I am using an intent to start another activity, and making my intent carry some data as an extra to the newly created activity. I am following a tutorial to do that.
The point is that findViewById(int id)
returns a generic View
object. This method doesn't parse your xml in order to understand what kind of type is your view. It just makes a new View
object from the relationship put in place by your R.java
file, built up by your IDE (Eclipse, I suppose).
You need to cast the result of findViewById(int id)
because you're not casting an EditText
object, your casting a View, of which EditText
is only a specification.