java.lang.RuntimeException: Unable to start activity ComponentInfo{com.entitcs.office_attendance/com.entitcs.office_attendance.activities.Drawer_Activity}: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{34e443c u0a335 TPSL idle change:procadj procs:0 seq(17166296,17166017)} caps=------ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4112) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4263) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:114) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:144) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:101) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2724) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:255) at android.os.Looper.loop(Looper.java:364) at android.app.ActivityThread.main(ActivityThread.java:8979) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1053) Caused by: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{34e443c u0a335 TPSL idle change:procadj procs:0 seq(17166296,17166017)} caps=------ at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1985) at android.app.ContextImpl.startService(ContextImpl.java:1930) at android.content.ContextWrapper.startService(ContextWrapper.java:835) at android.content.ContextWrapper.startService(ContextWrapper.java:835) at com.entitcs.office_attendance.activities.Drawer_Activity.onCreate(Unknown Source:323) at android.app.Activity.performCreate(Activity.java:8780) at android.app.Activity.performCreate(Activity.java:8752) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1475) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4086) ... 12 more