This “track” method is used to track the user’s standard events such as onClick, onLongClick and onFocusChange.
Method
public void track(@NonNull View view, **int** eventId, Context context, **boolean** addGeo)
Parameters
view - View of the UI element.
eventId - event ID based on the passing events which is defined in the SDK.
context - The activity context.
addGeo - Flag used to decide whether to append the geo parameter(latitude and longitude) in the Payloads or Not.
Example
Tracker.singleton().track(v, Tracker.EVENT_ID_CLICK, MainActivity.this, addGeo);
Tracker.singleton().track(v, Tracker.EVENT_ID_LONG_CLICK, MainActivity.this, addGeo);
Tracker.singleton().track(editTextOnFocusChange, Tracker.EVENT_ID_FOCUS_CHANGED, MainActivity.this, addGeo);