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{a0d8b92 u0a199 TPSL bg:+16m7s582ms idle change:cached procs:1 seq(0,0,0)} at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4486) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4524) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:181) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:102) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2207) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:238) at android.app.ActivityThread.main(ActivityThread.java:7834) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:986) 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{a0d8b92 u0a199 TPSL bg:+16m7s582ms idle change:cached procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1673) at android.app.ContextImpl.startService(ContextImpl.java:1609) at android.content.ContextWrapper.startService(ContextWrapper.java:680) at com.entitcs.office_attendance.activities.Drawer_Activity.l1(Unknown Source:7) at com.entitcs.office_attendance.activities.Drawer_Activity.onResume(Unknown Source:62) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1454) at android.app.Activity.performResume(Activity.java:8148) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4476) ... 11 more