java.lang.RuntimeException: Unable to start service com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng@987cf30 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:4720) at android.app.ActivityThread.access$2000(ActivityThread.java:255) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2099) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:8001) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1039) 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(Unknown Source:21) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.d(Unknown Source:25) at com.entitcs.office_attendance.background_works.ServiceToGetJustLatLng.onStartCommand(Unknown Source:69) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4702) ... 9 more