Skip to content

Instantly share code, notes, and snippets.

@wasnot
Created March 8, 2017 09:04
Show Gist options
  • Save wasnot/ba92c0ee52e647ee1c807a07686cb70e to your computer and use it in GitHub Desktop.
Save wasnot/ba92c0ee52e647ee1c807a07686cb70e to your computer and use it in GitHub Desktop.
@Override
protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
switch (visibility){
case VISIBLE://onResume called
case INVISIBLE:// onPause() called
}
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
if (hasWindowFocus) //onresume() called
else // onPause() called
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment