1Explain the Android activity lifecycle.
onCreate() (set up the UI and ViewModel) → onStart() (becoming visible) → onResume() (in the foreground, interactive) → onPause() (losing focus, e.g. a dialog or multi-window) → onStop() (no longer visible) → onDestroy() (finishing or being recreated). onRestart() runs when coming back from stopped.
Practical points: start camera, sensors or location updates in onStart/onResume and release them in onPause/onStop; save small UI state for process death; never assume onDestroy will be called (the OS can kill the process). On rotation, the activity is destroyed and recreated, which is why state goes in a ViewModel.