Display CrashActivity only in release mode

This commit is contained in:
Shinokuni 2024-11-17 14:46:07 +01:00
parent e9cd681b11
commit b74ad09a07
1 changed files with 10 additions and 8 deletions

View File

@ -26,6 +26,7 @@ open class ReadropsApp : Application(), KoinComponent, ImageLoaderFactory {
override fun onCreate() {
super.onCreate()
if (!BuildConfig.DEBUG) {
Thread.setDefaultUncaughtExceptionHandler { _, throwable ->
val intent = Intent(this, CrashActivity::class.java).apply {
putExtra(CrashActivity.THROWABLE_KEY, throwable)
@ -36,6 +37,7 @@ open class ReadropsApp : Application(), KoinComponent, ImageLoaderFactory {
startActivity(intent)
exitProcess(0)
}
}
startKoin {
androidLogger(Level.ERROR)