2
In a scenario where you have an Activity with a constructor (public, of course) and the onCreate method which is part of your life cycle. Which of the two will be executed first?
2
In a scenario where you have an Activity with a constructor (public, of course) and the onCreate method which is part of your life cycle. Which of the two will be executed first?
3
Think like this, if a constructor is the first "method" to be executed, before the others (even if there is the main method, in the case of JAVA), then obviously the constructor will be executed even before onCreate().
I hope I’ve helped!
Browser other questions tagged java android android-activity builder
You are not signed in. Login or sign up in order to post.
Do not use the Activity class constructor. Anything you think should/can do in the constructor
onCreate()
– ramaral
but answering the question.. According to the siclo d life of android, will be first realized what is on onCreate.
– Edumachdo
@Edumachdo The builder is always called first.
– ramaral