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{e7ae5d2 u0a331 SVC idle change:procadj procs:0 seq(1081895,1081844)} caps=------ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8893) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 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{e7ae5d2 u0a331 SVC idle change:procadj procs:0 seq(1081895,1081844)} caps=------ at android.app.ContextImpl.startServiceCommon(ContextImpl.java:2016) at android.app.ContextImpl.startService(ContextImpl.java:1961) at android.content.ContextWrapper.startService(ContextWrapper.java:842) at android.content.ContextWrapper.startService(ContextWrapper.java:842) at com.entitcs.office_attendance.activities.Drawer_Activity.onCreate(Drawer_Activity.java:367) at android.app.Activity.performCreate(Activity.java:8935) at android.app.Activity.performCreate(Activity.java:8904) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146) ... 12 more