java.lang.RuntimeException: Unable to resume activity {com.entitcs.office_attendance/com.entitcs.office_attendance.activities.Drawer_Activity}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{e6cb4e6 u0a78 TPSL bg:+8m12s685ms idle change:cached procs:1 seq(0,0,0)} at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4074) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4107) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2022) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7147) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:511) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876) Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{e6cb4e6 u0a78 TPSL bg:+8m12s685ms idle change:cached procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1611) at android.app.ContextImpl.startService(ContextImpl.java:1551) at android.content.ContextWrapper.startService(ContextWrapper.java:664) at com.entitcs.office_attendance.activities.Drawer_Activity.x1(Unknown Source:7) at com.entitcs.office_attendance.activities.Drawer_Activity.onResume(Unknown Source:65) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416) at android.app.Activity.performResume(Activity.java:7428) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4066) ... 11 more