1

I am using EasyTracker in my PreferenceActivity

@Override
public void onStart ()
{
    super.onStart();
    EasyTracker.getInstance(this).activityStart(this);
}

@Override
public void onStop ()
{
    super.onStop();
    EasyTracker.getInstance(this).activityStart(this);
}

But when I trying to call getTracker() method in EasyTracker class it is not there.

enter image description here

And this Android : Could not find method com.google.analytics.tracking.android.EasyTracker.getTracker do not help.

Community
  • 1
  • 1
Michal
  • 3,584
  • 9
  • 47
  • 74

2 Answers2

2

Using libGoogleAnalyticsV2.jar :

import com.google.analytics.tracking.android.EasyTracker;

    @Override
protected void onStart() {
    super.onStart();
    // Google Analytics Start Activity
    EasyTracker.getInstance().activityStart(this);
    EasyTracker.getTracker();
}

@Override
protected void onStop() {
    super.onStop();
    // Google Analytics Stop Activity
    EasyTracker.getInstance().activityStop(this);

}

Hope this helps.

Siddharth_Vyas
  • 9,972
  • 10
  • 39
  • 69
0

I believe you are using libGoogleAnalyticsServices.jar Version 3.x, where they change the API, so now the getIntance() method requires a Context object as an input. If you are using this inside an Activity just pass MyActivityName.this as a value.

For more information, see the Google Analytics SDK for Android: Migrating to v3: https://developers.google.com/analytics/devguides/collection/android/v3/migration

DevNG
  • 5,875
  • 3
  • 18
  • 14