I have created class ScreenDrawer
that has 3 functions. And I have a class ChatsScreen
that inherits the ScreenDrawer
. But for some reason when I click Ctrl O in Android Studio I don't see methods that I can override
as I can do in MainActivity
that extends AppCompatActivity
.
So how I need to organize classes so my ChatsScreen
could see ScreenDrawer
methods by inherit it.
Here is my ChatsScreen
Here is my ScreenDrawer
that need to be extended by ChatsScreen
Now I got this in methods
CodePudding user response:
Any methods you want to override
have to be open
too (or already overridden, or abstract
). Check the docs
The override modifier is required for
Circle.draw()
. If it were missing, the compiler would complain. If there is noopen
modifier on a function, likeShape.fill()
, declaring a method with the same signature in a subclass is not allowed, either withoverride
or without it.