wisemen-digital/NoInternetDialog

Crash when switching between Activities

Duna opened this issue · 2 comments

Duna commented

Have 2 activities and have .onDestroy dialog implementation when onDestroy activity.
Both of them initialize this library dialog at onCreate

Navigate from Activity A->B->A -> crash at onDestroy

I had the same issue. It was easily solved by not putting nointernetDialog.onDestroy in onStop and just in onDestroy.

`
@OverRide
protected void onStop() {
super.onStop();
}

@Override
protected void onResume() {
    super.onResume();
    noInternetDialog = new NoInternetDialog.Builder(this).build();
}

@Override
protected void onDestroy() {
    super.onDestroy();
    noInternetDialog.onDestroy();
}`