@Override public void onStart(){
  super.onStart();
  setupUi();
}

@ Override public void onStart ( ) { super . onStart ( ) ; setupUi ( ) ; }
note , we defer the state check and screen setup to onstart ( ) because this will be re - run if the user clicks the power button ( sleeping / waking the screen ) , and this is especially important if we were to lose the wakelock for any reason .
