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{888b1d5 u0a149 TPSL idle procs:1 seq(0,0,0)} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3146) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3296) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:114) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:74) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:226) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:500) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:913) 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{888b1d5 u0a149 TPSL idle procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1623) at android.app.ContextImpl.startService(ContextImpl.java:1563) at android.content.ContextWrapper.startService(ContextWrapper.java:675) at com.entitcs.office_attendance.activities.Drawer_Activity.onCreate(Unknown Source:317) at android.app.Activity.performCreate(Activity.java:7337) at android.app.Activity.performCreate(Activity.java:7328) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3126) ... 11 more