I am implementing the google analytics in my android app. While accessing the Application class from mainactivity the following error is coming:

```
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gaa/com.example.gaa.Activity}: java.lang.ClassCastException: android.app.Application cannot be cast to com.example.gaa.GAApp

```

I am calling application class from activity class by given code: 

```
((GAApplication)getApplication()).getTracker(GAApplication.TrackerName.APP_TRACKER);

```