Skip to content

Commit

Permalink
enh: Allow back navigation from stacktrace view
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Apr 18, 2023
1 parent 4e81506 commit 505d307
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -16,9 +16,11 @@

package com.cyb3rko.pincredible

import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat
import com.cyb3rko.backpack.utils.openUrl
Expand All @@ -35,6 +37,14 @@ class UncaughtExceptionActivity : AppCompatActivity() {

binding = ActivityUncaughtExceptionBinding.inflate(layoutInflater)
setContentView(binding.root)

val onBackPressedCallback = object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
finish()
startActivity(Intent(applicationContext, MainActivity::class.java))
}
}
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
}

override fun onPostCreate(savedInstanceState: Bundle?) {
Expand Down

0 comments on commit 505d307

Please sign in to comment.