Skip to content

Instantly share code, notes, and snippets.

@talenguyen
Created February 22, 2019 00:20
Show Gist options
  • Save talenguyen/71a635ecd0654318d12cdf893323b886 to your computer and use it in GitHub Desktop.
Save talenguyen/71a635ecd0654318d12cdf893323b886 to your computer and use it in GitHub Desktop.
Declare StrictMode to detect performance issue
class App: Application {
override fun onCreate() {
super.onCreate()
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork()
.penaltyDeath()
.penaltyLog()
.build())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment