Android google analytics integration error
When i am trying to get tracker in my activity it show error that -this method is undefine "getactivity()" in google analytic v4 // Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()) .getTracker(TrackerName.APP_TRACKER); If you haven't done so already, create a class MyApplication extends Application for your app, and make sure you add it to your manifest as below (the property that matters here is android:name, I've removed the other xml properties for clarity). <application android:name="mypackagename.MyApplication" ... > Then, in your MyApplication class, create