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{67c6517 u0a180 TPSL idle procs:0 seq(0,0,0)} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3683) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3840) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:105) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:136) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7932) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 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{67c6517 u0a180 TPSL idle procs:0 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1862) at android.app.ContextImpl.startService(ContextImpl.java:1818) at android.content.ContextWrapper.startService(ContextWrapper.java:776) at android.content.ContextWrapper.startService(ContextWrapper.java:776) at com.entitcs.office_attendance.activities.Drawer_Activity.onCreate(Unknown Source:323) at android.app.Activity.performCreate(Activity.java:8060) at android.app.Activity.performCreate(Activity.java:8040) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3653) ... 12 more