noInternet Activity crash fixed

This commit is contained in:
Bnyro 2022-06-05 19:46:56 +02:00
parent cbf05d292b
commit 52be2cb8b7
2 changed files with 8 additions and 2 deletions

View File

@ -282,8 +282,13 @@ class MainActivity : AppCompatActivity() {
} }
} }
} catch (e: Exception) { } catch (e: Exception) {
navController.popBackStack() // try catch to prevent nointernet activity to crash
moveTaskToBack(true) try {
navController.popBackStack()
moveTaskToBack(true)
} catch (e: Exception){
super.onBackPressed()
}
} }
} }

View File

@ -39,6 +39,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="@string/retry" android:text="@string/retry"
android:textColor="?android:attr/colorBackground"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/noInternet_textView" /> app:layout_constraintTop_toBottomOf="@+id/noInternet_textView" />