java.lang.RuntimeException: Unable to start service com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng@8c73027 with Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.MyLocationService }: app is in background uid UidRecord{2788c41 u0a132 SVC idle change:idle|uncached procs:1 seq(0,0,0)} at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3698) at android.app.ActivityThread.access$1600(ActivityThread.java:200) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6762) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.MyLocationService }: app is in background uid UidRecord{2788c41 u0a132 SVC idle change:idle|uncached procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1577) at android.app.ContextImpl.startService(ContextImpl.java:1532) at android.content.ContextWrapper.startService(ContextWrapper.java:664) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.c(Unknown Source:172) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.d(Unknown Source:34) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.onStartCommand(Unknown Source:64) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3679) ... 8 more