Skip to content

Commit 9857cd4

Browse files
committed
feat: enable custom crash activity
Therefore, app will launch LogAcitity to show logcat instead of showing a simple crash dialog via system.
1 parent 2080ce9 commit 9857cd4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/main/java/com/osfans/trime/TrimeApplication.kt

+7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package com.osfans.trime
22

33
import android.app.Application
44
import android.os.Process
5+
import cat.ereza.customactivityoncrash.config.CaocConfig
56
import com.osfans.trime.data.AppPrefs
7+
import com.osfans.trime.settings.LogActivity
68
import timber.log.Timber
79

810
/**
@@ -24,6 +26,11 @@ class TrimeApplication : Application() {
2426

2527
override fun onCreate() {
2628
super.onCreate()
29+
CaocConfig.Builder
30+
.create()
31+
.errorActivity(LogActivity::class.java)
32+
.enabled(!BuildConfig.DEBUG)
33+
.apply()
2734
instance = this
2835
try {
2936
if (BuildConfig.DEBUG) {

0 commit comments

Comments
 (0)