mirror of
https://github.com/dzeiocom/crashhandler.git
synced 2025-04-22 10:52:16 +00:00
fix: Add prefs to the demo app (#5)
This commit is contained in:
parent
4b69425b94
commit
09cb0abcb7
@ -46,4 +46,7 @@ dependencies {
|
|||||||
|
|
||||||
// Navigation because I don't want to maintain basic transactions and shit
|
// Navigation because I don't want to maintain basic transactions and shit
|
||||||
implementation("androidx.navigation:navigation-fragment-ktx:2.5.1")
|
implementation("androidx.navigation:navigation-fragment-ktx:2.5.1")
|
||||||
|
|
||||||
|
// preferences
|
||||||
|
implementation("androidx.preference:preference-ktx:1.2.0")
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.dzeio.crashhandlertest
|
package com.dzeio.crashhandlertest
|
||||||
|
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import com.dzeio.crashhandler.CrashHandler
|
import com.dzeio.crashhandler.CrashHandler
|
||||||
import com.dzeio.crashhandlertest.ui.ErrorActivity
|
import com.dzeio.crashhandlertest.ui.ErrorActivity
|
||||||
|
|
||||||
@ -7,9 +8,13 @@ class Application : android.app.Application() {
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
|
||||||
|
val prefs = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
|
|
||||||
CrashHandler.Builder()
|
CrashHandler.Builder()
|
||||||
.withActivity(ErrorActivity::class.java)
|
.withActivity(ErrorActivity::class.java)
|
||||||
.withContext(this)
|
.withContext(this)
|
||||||
|
.withPrefs(prefs)
|
||||||
|
.withPrefsKey("com.dzeio.crashhandler.key")
|
||||||
.withPrefix("Pouet :D")
|
.withPrefix("Pouet :D")
|
||||||
.withSuffix("WHYYYYY")
|
.withSuffix("WHYYYYY")
|
||||||
.build().setup()
|
.build().setup()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user