By

Problem
When attempting to cast an Android application object to another type you get the error “Solution to Error java.lang.ClassCastException: android.app.Application cannot be cast …”
Cause
1. The type being casted to does not extend the type Application
2. The type has not been defined in the Android manifest
Solution
See the article on how to correctly setup a custom Android Application Class here: http://www.stevenmarkford.com/hook-into-android-application-start-event-oncreate-extending-the-application-class/

Share


  Hi, I'm Steven and the author of this blog
  Follow me on or