Callback while entering in background or foreground