java.lang.RuntimeException: Unable to start service com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng@c40960a 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:3190) at android.app.ActivityThread.access$2400(ActivityThread.java:165) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1571) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:179) at android.app.ActivityThread.main(ActivityThread.java:5730) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681) 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:3159) ... 8 more