EasyTracker (GoogleAnalytics) for Android in TabActivity and others

I am trying to use EasyTracker in my project. But one of the Shares expands TabActivity.

To use EasyTracker, all actions must expand TrackedActivity.

I think it is not possible to extend it with my TabActivity subclass without changing Android or the EasyTracker source.

I am wondering if the "normal" tracking (which I will use for this action) and the EasyTracker inheritance tracking can be mixed. But it seems at least impractical. From EasyTracker doc:

  • Please note that all your actions should extend TrackedActivity (or
  • equivalent activity e.g. TrackedListActivity instead of ListActivity) for
  • This class should properly track application usage and usage time.

So what should I do?

+3
source share
1 answer

The solution is quite simple, but I had to be lazy to find it yesterday.

  • Download source EasyTracker
  • Copy TrackedActivity and rename it to something like TrackedTabActivity
  • Make extension TabActivity instead of Activity
  • Include this file in the project
  • Subclass TabActivity, add TrackedTabActivity instead.

The same principle for other activity subclasses, such as PreferenceActivity, etc.

+3
source

All Articles