java.lang.RuntimeException: Unable to start service com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng@3a742686 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:3149) at android.app.ActivityThread.access$2500(ActivityThread.java:165) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1515) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5669) 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:960) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 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:3112) ... 9 more