java.lang.RuntimeException: Unable to start activity ComponentInfo{com.entitcs.office_attendance/com.entitcs.office_attendance.CRM.CRM_Customer_Search}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{c85e1d3 u0a261 TPSL idle procs:1 seq(0,0,0)} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3537) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3692) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2235) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:240) at android.app.ActivityThread.main(ActivityThread.java:7829) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027) 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{c85e1d3 u0a261 TPSL idle procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1675) at android.app.ContextImpl.startService(ContextImpl.java:1610) at android.content.ContextWrapper.startService(ContextWrapper.java:680) at android.content.ContextWrapper.startService(ContextWrapper.java:680) at com.entitcs.office_attendance.CRM.CRM_Customer_Search.onCreate(Unknown Source:193) at android.app.Activity.performCreate(Activity.java:7980) at android.app.Activity.performCreate(Activity.java:7969) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3508) ... 11 more