Android Lifecycle
Activity/Fragment Lifecycle, Configuration Changes and state management
1What is the correct lifecycle order of an Activity when starting?
What is the correct lifecycle order of an Activity when starting?
Antwoord
An Activity's lifecycle starts with onCreate() (initialization and view creation), followed by onStart() (Activity becomes visible but not yet interactive), then onResume() (Activity in foreground and interactive). This sequence is always the same for each Activity start.
2Which first lifecycle method is called when the Activity goes to background?
Which first lifecycle method is called when the Activity goes to background?
Antwoord
onPause() is the first method called when the Activity starts losing focus. It's followed by onStop() when the Activity is no longer visible at all. Critical data should be saved in onPause() as the system may kill the process after this method without calling onStop().
3In which method should you initialize Views (findViewById, ViewBinding)?
In which method should you initialize Views (findViewById, ViewBinding)?
Antwoord
onCreate() is the appropriate method to initialize Views as this is where setContentView() is called and the View hierarchy is created. Views are not yet available before onCreate(). You can also use onViewCreated() in Fragments.
What is the difference between onPause() and onStop()?
What happens during screen rotation by default?
+27 gespreksvragen
Andere Android-sollicitatieonderwerpen
Android Fundamentals
Android UI and Resources
Android Navigation
Android Data Management
Android Networking
Android Testing
Android Gradle
Kotlin Language Essentials for Android
Room Database
Background Work
Jetpack Compose
Permissions and Device Features
Firebase for Android
Android MVVM Architecture
Advanced Android Networking
Kotlin Collections and Operators
Kotlin Coroutines and Flow
Android Dependency Injection
Android MVI Architecture
Android Clean Architecture
Android Compose Advanced
Android Performance and Monitoring
Android Security and Privacy
Android CI/CD and Release
Android UX and Form Factors
Android Testing Advanced
Beheers Android voor je volgende gesprek
Krijg toegang tot alle vragen, flashcards, technische tests, code review-oefeningen en gespreksimulatoren.
Begin gratis