Strict mode for debugging
This commit is contained in:
parent
7199daf81a
commit
b75a390507
@ -2,6 +2,8 @@ package de.danoeh.antennapod;
|
|||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.StrictMode;
|
||||||
|
|
||||||
import com.joanzapata.iconify.Iconify;
|
import com.joanzapata.iconify.Iconify;
|
||||||
import com.joanzapata.iconify.fonts.FontAwesomeModule;
|
import com.joanzapata.iconify.fonts.FontAwesomeModule;
|
||||||
@ -38,6 +40,22 @@ public class PodcastApp extends Application {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
|
if(BuildConfig.DEBUG) {
|
||||||
|
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder()
|
||||||
|
.detectLeakedSqlLiteObjects()
|
||||||
|
.penaltyLog()
|
||||||
|
.penaltyDeath();
|
||||||
|
if (Build.VERSION.SDK_INT >= 11) {
|
||||||
|
builder.detectActivityLeaks();
|
||||||
|
builder.detectLeakedClosableObjects();
|
||||||
|
}
|
||||||
|
if(Build.VERSION.SDK_INT >= 16) {
|
||||||
|
builder.detectLeakedRegistrationObjects();
|
||||||
|
}
|
||||||
|
StrictMode.setVmPolicy(builder.build());
|
||||||
|
}
|
||||||
|
|
||||||
singleton = this;
|
singleton = this;
|
||||||
LOGICAL_DENSITY = getResources().getDisplayMetrics().density;
|
LOGICAL_DENSITY = getResources().getDisplayMetrics().density;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user