I am trying to integrate Google Analytics in my Activities. As per the official documentation i used the “Easy Tracker” Library provided by Google and extended my activities from “TrackedActivity” The exact syntax i use is:
EasyTracker.getTracker().trackPageView("/myview"+viewname);
I am getting Null Pointer Exception randomly but Logcat shows “at Google Analytics” and surprisingly not at any place in my code. In some of my activities, I am calling system.gc() function in the onDestroy() method. (Could be the issue) Its supposed to be a singleton object I am worried if its getting garbage collected?
Needless to say as of now my app crashes. What worries me further is that even if i do a try catch or put exception checkers ie. check across null object. I am still worried that my activities might not get tracked even if the Crash is avoided.
Please Suggest.
Make sure that you don’t invoke methods of
EasyTrackerbeforeonStart()of your Activity. Also setga_debugandga_auto_activity_trackingto"true"to get debug statements and to track all activities of the application respectively.