java.lang.RuntimeException: Unable to start service com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng@1b36b1b9 with Intent { cmp=com.entitcs.office_attendance/.background_works.ServiceToGetJustLatLng }: java.lang.ClassCastException: com.entitcs.office_attendance.model_classes.MyApplication cannot be cast to android.app.Activity at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4000) at android.app.ActivityThread.access$2300(ActivityThread.java:211) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1803) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6946) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by: java.lang.ClassCastException: com.entitcs.office_attendance.model_classes.MyApplication cannot be cast to android.app.Activity at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.a(SourceFile) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.d(SourceFile) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.onStartCommand(SourceFile) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3983) ... 9 more