java.lang.RuntimeException: Unable to resume activity {com.entitcs.office_attendance/com.entitcs.office_attendance.activities.Drawer_Activity}: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{7eae33 u0a285 TPSL bg:+8m35s575ms idle change:cached|procstate|procadj procs:0 seq(61322462,61322260)} at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5060) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5103) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:225) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2466) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:240) at android.os.Looper.loop(Looper.java:351) at android.app.ActivityThread.main(ActivityThread.java:8380) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013) Caused by: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{7eae33 u0a285 TPSL bg:+8m35s575ms idle change:cached|procstate|procadj procs:0 seq(61322462,61322260)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1931) at android.app.ContextImpl.startService(ContextImpl.java:1881) at android.content.ContextWrapper.startService(ContextWrapper.java:827) at android.content.ContextWrapper.startService(ContextWrapper.java:827) at com.entitcs.office_attendance.activities.Drawer_Activity.C1(Unknown Source:7) at com.entitcs.office_attendance.activities.Drawer_Activity.onResume(Unknown Source:65) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1550) at android.app.Activity.performResume(Activity.java:8540) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5042) ... 13 more