I'm writing a custom view that directly extends android.view.View
. If I try to access fields mScrollX
or mScrollY
, I see an error that the field "cannot be resolved or is not a field." The source code for android.view.View has mScrollX, mScrollY, and similar variables declared protected
. How is it that my direct subclass cannot access protected fields of its parent class? (Classes like ScrollView apparently can.)
P.S. I realize that I can call getScrollX()
, but I want to update these fields; calling setScroll()
has side effects that I don't want.