Fill the blank
Turn on main-thread checks in debug builds.
class App : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(
StrictMode.ThreadPolicy.Builder().____().penaltyLog().build()
)
}
}
}Hint 1 of 1
Which call turns on detection?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A detectAll
Correct. It detects disk, network and other main-thread violations.
Why not the others?
- B permitAll. That allows everything.
- C detectLeakedClosableObjects. That's a VM policy check.
- D penaltyDeath. That's a penalty, not a detection.