java.lang.RuntimeException: Unable to start activity ComponentInfo{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{78c6557 u0a146 TRNB bg:+1m28s810ms idle change:uncached procs:1 seq(3177,3177,3177)} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3403) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3587) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2185) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7593) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) 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{78c6557 u0a146 TRNB bg:+1m28s810ms idle change:uncached procs:1 seq(3177,3177,3177)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1810) at android.app.ContextImpl.startService(ContextImpl.java:1765) at android.content.ContextWrapper.startService(ContextWrapper.java:664) at com.entitcs.office_attendance.activities.Drawer_Activity.onCreate(Unknown Source:317) at android.app.Activity.performCreate(Activity.java:7458) at android.app.Activity.performCreate(Activity.java:7448) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3382) ... 11 more