java.lang.RuntimeException: Unable to start activity ComponentInfo{com.entitcs.office_attendance/com.entitcs.office_attendance.CRM.CRM_Retailer_List}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: app is in background uid UidRecord{36ceb5c u0a3819 TPSL idle procs:1 seq(0,0,0)} at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3507) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3661) 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:2232) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:238) at android.app.ActivityThread.main(ActivityThread.java:7824) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981) 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{36ceb5c u0a3819 TPSL idle procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1671) at android.app.ContextImpl.startService(ContextImpl.java:1607) at android.content.ContextWrapper.startService(ContextWrapper.java:680) at android.content.ContextWrapper.startService(ContextWrapper.java:680) at com.entitcs.office_attendance.CRM.CRM_Retailer_List.onCreate(CRM_Retailer_List.java:409) at android.app.Activity.performCreate(Activity.java:7963) at android.app.Activity.performCreate(Activity.java:7952) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3482) ... 11 more