Пример #1
0
        @Override
        public void onReceive(Context context, Intent intent) {
          final String action = intent.getAction();

          if (action.equals(Intent.ACTION_TIME_CHANGED)
              || action.equals(Intent.ACTION_TIMEZONE_CHANGED)) {
            Manager.cancelPrayerAlarm();
            Manager.initPrayerState(PrayerService.this);
            Manager.initPrayerAlarm(PrayerService.this, PrayerReceiver.class);
          }
        }
Пример #2
0
  @Override
  public void onCreate() {
    try {
      super.onCreate();
      Manager.initPrayerState(this);
      Manager.initPrayerAlarm(this, PrayerReceiver.class);
      this.registerReceiver(this.m_timeChangedReceiver, s_intentFilter);
      // prayerHandler = new PrayerHandler2(this);
      // prayerHandler.postDelayed(mUpdateTimeTask, 10000); // as soon as possible ( 10 seconds )

    } catch (Exception e) {
      // Log.e("onCreateService", e.getMessage(), e.getCause());
    }
  }