Answer the question
In order to leave comments, you need to log in
How can we see Activity without creating OnStart and OnResume methods?
I created an empty file with only Hello World . I wanted to see how the activity life cycle works, but I noticed that MainActivity only has an overridden OnCreate method . And at startup, we accordingly see the Activity itself (that is, at the OnResume level ).
The question is, how can we see it without calling these methods?? (only the OnCreate method is called )
Answer the question
In order to leave comments, you need to log in
No, you are wrong. All the necessary methods are there and called. It's just that they are not overridden, which means they are used inherited from AppCompatActivity, look for them there.
You can see the life cycle either in the debugger, or by overriding all the necessary methods. In the body of the overridden methods, call them from the parent class via super and add your logs, or whatever you want there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question