@Override public void onVisibilityChanged(boolean visible){
  super.onVisibilityChanged(visible);
  if (visible) {
    registerReceiver();
    calendar.setTimeZone(TimeZone.getDefault());
  }
 else {
    unregisterReceiver();
  }
  updateTimer();
}

@ Override public void onVisibilityChanged ( boolean visible ) { super . onVisibilityChanged ( visible ) ; if ( visible ) { registerReceiver ( ) ; calendar . setTimeZone ( TimeZone . getDefault ( ) ) ; } else { unregisterReceiver ( ) ; } updateTimer ( ) ; }
called when device does into or out of interactive mode .
