user3816094 user3816094 - 3 months ago 39
Java Question

Why findViewByID can call without super keyword

I'm new to java and android programming. As far as I know,

was defined on parent classes and I'm just curious about why
method can call without
keyword in child class.


Without overriding the findViewById method in the child class, super and this are equivalent.

The view that you are trying to find is in this class, not the super class.

You can do this.findViewById(), or ActivityName.this.findViewById() but that is just redundant.

Related question to ask: Why doesn't setContentView need a super?