Skip to content

Instantly share code, notes, and snippets.

@guliash
Last active October 1, 2017 23:06
Show Gist options
  • Save guliash/6d6661ca9391005f35b19bedc44a988a to your computer and use it in GitHub Desktop.
Save guliash/6d6661ca9391005f35b19bedc44a988a to your computer and use it in GitHub Desktop.
check whether fragment destroyed permanently
void onDestroy() {
if (getActivity.isFinishing()) {
//разрушаемся навсегда
} else if (getActivity.isChangingConfigurations()) {
//разрушаемся не навсегда
} else {
//разрушаемся навсегда
//кажется тут остаются варианты - удалили из бэк стека или вызвали remove у транзакции
//Или уничтожился процесс - тогда кеш презентеров все равно теряется
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment