Search in sources :

Example 1 with ApplicationLifecycleUtil

use of com.kickstarter.libs.utils.ApplicationLifecycleUtil in project android-oss by kickstarter.

the class KSApplication method onCreate.

@Override
@CallSuper
public void onCreate() {
    super.onCreate();
    // Send crash reports in release builds
    if (!BuildConfig.DEBUG && !isInUnitTests()) {
        checkForCrashes();
    }
    MultiDex.install(this);
    // Only log for internal builds
    if (BuildConfig.FLAVOR_AUDIENCE.equals("internal")) {
        Timber.plant(new Timber.DebugTree());
    }
    if (!isInUnitTests() && ApiCapabilities.canDetectMemoryLeaks()) {
        refWatcher = LeakCanary.install(this);
    }
    JodaTimeAndroid.init(this);
    component = DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();
    component().inject(this);
    CookieHandler.setDefault(cookieManager);
    FacebookSdk.sdkInitialize(this);
    pushNotifications.initialize();
    final ApplicationLifecycleUtil appUtil = new ApplicationLifecycleUtil(this);
    registerActivityLifecycleCallbacks(appUtil);
    registerComponentCallbacks(appUtil);
}
Also used : Timber(timber.log.Timber) ApplicationLifecycleUtil(com.kickstarter.libs.utils.ApplicationLifecycleUtil) CallSuper(android.support.annotation.CallSuper)

Aggregations

CallSuper (android.support.annotation.CallSuper)1 ApplicationLifecycleUtil (com.kickstarter.libs.utils.ApplicationLifecycleUtil)1 Timber (timber.log.Timber)1