java.lang.RuntimeException: Unable to pause activity {com.entitcs.office_attendance/com.entitcs.office_attendance.CRM.InvoiceReport}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{7b2ab9 u0a250 SVC bg:+2m41s174ms idle change:idle procs:1 seq(62,62,62)} at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4344) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4299) at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4251) at android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:45) 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:2013) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:211) at android.app.ActivityThread.main(ActivityThread.java:7234) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:503) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:887) 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{7b2ab9 u0a250 SVC bg:+2m41s174ms idle change:idle procs:1 seq(62,62,62)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1635) at android.app.ContextImpl.startService(ContextImpl.java:1572) at android.content.ContextWrapper.startService(ContextWrapper.java:675) at android.content.ContextWrapper.startService(ContextWrapper.java:675) at l3.q3.onCreateView(Unknown Source:65) at androidx.fragment.app.Fragment.performCreateView(Unknown Source:19) at androidx.fragment.app.v.f(Unknown Source:188) at androidx.fragment.app.v.m(Unknown Source:116) at androidx.fragment.app.n.e0(Unknown Source:277) at androidx.fragment.app.n.f1(Unknown Source:84) at androidx.fragment.app.n.b0(Unknown Source:21) at androidx.fragment.app.n.T(Unknown Source:42) at androidx.fragment.app.n.N(Unknown Source:1) at androidx.fragment.app.i.m(Unknown Source:4) at androidx.fragment.app.e.onPause(Unknown Source:8) at com.entitcs.office_attendance.CRM.InvoiceReport.onPause(Unknown Source:0) at android.app.Activity.performPause(Activity.java:7509) at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1466) at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4334) ... 12 more