ساعت سخنگو برای فارسی زبانان
| 1 | package ir.hamed.klox; |
| 2 | import android.content.*;import android.os.Build; |
| 3 | public class ScheduleReceiver extends BroadcastReceiver{public static final String ACTION_ANNOUNCE="ir.hamed.klox.ANNOUNCE";@Override public void onReceive(Context context,Intent intent){if(!ACTION_ANNOUNCE.equals(intent.getAction()))return;Intent service=new Intent(context,ClockAnnouncementService.class);if(Build.VERSION.SDK_INT>=26)context.startForegroundService(service);else context.startService(service);ScheduleManager.scheduleNext(context);}} |