mirror of
https://github.com/yogeshpaliyal/KeyPass.git
synced 2026-01-08 00:49:47 -06:00
committed by
GitHub
parent
fa252b2366
commit
1a3d346087
@@ -7,7 +7,6 @@ import androidx.hilt.work.HiltWorkerFactory
|
||||
import androidx.work.Configuration
|
||||
import com.google.android.material.color.DynamicColors
|
||||
import javax.inject.Inject
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
abstract class CommonMyApplication : Application(), Configuration.Provider {
|
||||
|
||||
@@ -18,12 +17,13 @@ abstract class CommonMyApplication : Application(), Configuration.Provider {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Thread.setDefaultUncaughtExceptionHandler { _, throwable ->
|
||||
Log.d("MyApplication", "crashed ")
|
||||
|
||||
val previewExceptionHandler = Thread.getDefaultUncaughtExceptionHandler()
|
||||
Thread.setDefaultUncaughtExceptionHandler { thread, throwable ->
|
||||
val intent = getCrashActivityIntent(throwable)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
startActivity(intent)
|
||||
exitProcess(1)
|
||||
previewExceptionHandler?.uncaughtException(thread, throwable)
|
||||
}
|
||||
|
||||
DynamicColors.applyToActivitiesIfAvailable(this)
|
||||
|
||||
Reference in New Issue
Block a user