Example usage for org.joda.time DateTimeZone setProvider

List of usage examples for org.joda.time DateTimeZone setProvider

Introduction

In this page you can find the example usage for org.joda.time DateTimeZone setProvider.

Prototype

public static void setProvider(Provider provider) throws SecurityException 

Source Link

Document

Sets the zone provider factory.

Usage

From source file:com.metinkale.prayerapp.App.java

License:Apache License

@Override
public void onCreate() {
    super.onCreate();
    if (LeakCanary.isInAnalyzerProcess(this)) {
        return;//from ww  w.  j ava 2 s .  c  o m
    }
    LeakCanary.install(this);

    Fabric.with(this, new Crashlytics());
    Crashlytics.setUserIdentifier(Prefs.getUUID());
    if (BuildConfig.DEBUG)
        Crashlytics.setBool("isDebug", true);

    JobManager.create(this).addJobCreator(new MyJobCreator());

    mDefaultUEH = Thread.getDefaultUncaughtExceptionHandler();
    Thread.setDefaultUncaughtExceptionHandler(mCaughtExceptionHandler);

    DateTimeZone.setProvider(new AndroidTimeZoneProvider());
    registerReceiver(new TimeZoneChangedReceiver(), new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED));

    try {
        Times.getTimes();
    } catch (Exception e) {
        Crashlytics.logException(e);
    }

    Utils.init(this);

    startService(new Intent(this, WidgetService.class));
    Times.setAlarms();

    PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);

    if ("longcheer".equalsIgnoreCase(Build.BRAND) || "longcheer".equalsIgnoreCase(Build.MANUFACTURER)
            || "general mobile".equalsIgnoreCase(Build.BRAND)
            || "general mobile".equalsIgnoreCase(Build.MANUFACTURER)
            || "general_mobile".equalsIgnoreCase(Build.BRAND)
            || "general_mobile".equalsIgnoreCase(Build.MANUFACTURER)) {
        new ANRWatchDog().start();
    }

    if (AppRatingDialog.getInstallationTime() == 0) {
        AppRatingDialog.setInstalltionTime(System.currentTimeMillis());
    }
}