Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.goooler.demoapp.common

import android.os.StrictMode
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.header.ClassicsHeader
import com.scwang.smart.refresh.layout.SmartRefreshLayout
Expand All @@ -17,6 +18,7 @@ abstract class CommonApplication : BaseApplication() {
CrashHandler.init()
ImageLoader.init(this)
initSmartRefresh()
enableStrictMode()
}

private fun initSmartRefresh() {
Expand All @@ -31,6 +33,16 @@ abstract class CommonApplication : BaseApplication() {
}
}

private fun enableStrictMode() {
if (BuildConfig.DEBUG) {
val threadPolicy = StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build()
StrictMode.setThreadPolicy(threadPolicy)
}
}

companion object {
lateinit var app: CommonApplication
private set
Expand Down