Android Developer Question: Download Questions PDF
Tell us why would you do the setContentView() in onCreate() of Activity class?
![Android Developer Interview Answer Android Developer Interview Question](https://globalguideline.com/public/images/interview/19.png)
Answer:
As onCreate() of an Activity is called only once, this is the point where most initialisation should go. It is inefficient to set the content in onResume() or onStart() (which are called multiple times) as the setContentView() is a heavy operation.
Download Android Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Please explain what is a Sticky Intent? | Tell us what is a BuildType in Gradle? And what can you use it for? |