@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); } }
@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()); } }