本文整理汇总了Java中com.google.analytics.tracking.android.EasyTracker.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java EasyTracker.getInstance方法的具体用法?Java EasyTracker.getInstance怎么用?Java EasyTracker.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.analytics.tracking.android.EasyTracker
的用法示例。
在下文中一共展示了EasyTracker.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mApp = CatnutApp.getTingtingApp();
if (savedInstanceState == null) {
final FragmentManager fragmentManager = getFragmentManager();
fragmentManager.addOnBackStackChangedListener(this);
Intent intent = getIntent();
final long uid = intent.getLongExtra(Constants.ID, 0L);
Uri uri = intent.getData();
String screenName =
uri == null ? intent.getStringExtra(User.screen_name) : uri.getLastPathSegment();
fragmentManager
.beginTransaction()
.replace(android.R.id.content, ProfileFragment.getFragment(uid, screenName))
.commit();
if (mApp.getPreferences().getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
}
ActionBar bar = getActionBar();
bar.setIcon(R.drawable.ic_title_profile_default);
bar.setDisplayHomeAsUpEnabled(true);
}
示例2: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (CatnutApp.getTingtingApp().getPreferences()
.getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
ActionBar bar = getActionBar();
bar.setIcon(R.drawable.ic_title_view_tweet);
bar.setDisplayHomeAsUpEnabled(true);
long id = getIntent().getLongExtra(Constants.ID, 0L);
String json = getIntent().getStringExtra(Constants.JSON);
if (savedInstanceState == null) {
TweetFragment fragment = id != 0L
? TweetFragment.getFragment(id)
: TweetFragment.getFragment(json);
// 添加back回调
mKeyDownListener = fragment;
getFragmentManager().beginTransaction()
.replace(android.R.id.content, fragment)
.commit();
}
}
示例3: setupUncaughtExceptionHandler
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
/**
* Report uncaught exceptions (crashes) to Analytics
*/
private void setupUncaughtExceptionHandler() {
ExceptionReporter myHandler = new ExceptionReporter(EasyTracker.getInstance(this),
GAServiceManager.getInstance(), Thread.getDefaultUncaughtExceptionHandler(), this);
StandardExceptionParser exceptionParser =
new StandardExceptionParser(getApplicationContext(), null) {
@Override
public String getDescription(String threadName, Throwable t) {
return "{" + threadName + "} " + "{" + Build.MODEL + "} " + "{" + Build.VERSION.SDK_INT + "} " + Log.getStackTraceString(t);
}
};
myHandler.setExceptionParser(exceptionParser);
Thread.setDefaultUncaughtExceptionHandler(myHandler);
}
示例4: onStart
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onStart() {
super.onStart();
final Tracker tracker = EasyTracker.getInstance(getActivity());
tracker.set(Fields.SCREEN_NAME, "Recipes list");
tracker.send(MapBuilder.createAppView().build());
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(RecipesManager.ACTION_FINISH_LOADING_RECIPES);
intentFilter.addAction(RecipesManager.ACTION_START_LOADING_RECIPES);
if (RecipesApplication.isLoadingRecipes) {
getActivity().setProgressBarIndeterminateVisibility(true);
} else {
getActivity().setProgressBarIndeterminateVisibility(false);
}
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(broadcastReceiver,
intentFilter);
}
示例5: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar bar = getActionBar();
bar.setTitle(R.string.plugins);
getFragmentManager().addOnBackStackChangedListener(this);
int which = getIntent().getIntExtra(Constants.ACTION, -1);
switch (which) {
case ACTION_ZHIHU_ITEM:
case ACTION_ZHIHU_PAGER:
if (savedInstanceState == null) {
Fragment fragment =
which == ACTION_ZHIHU_ITEM
? ZhihuItemFragment.getFragment(getIntent().getLongExtra(Constants.ID, 0L))
: PagerItemFragment.getFragment(getIntent().getLongExtra(Constants.ID, 0L),
getIntent().getLongExtra(PagerItemFragment.ORDER_ID, 0L));
getFragmentManager().beginTransaction()
.replace(android.R.id.content, fragment)
.commit();
}
break;
default:
injectPager(bar, savedInstanceState);
break;
}
if (CatnutApp.getTingtingApp().getPreferences().getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
}
示例6: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new OAuthFragment())
.commit();
}
if (CatnutApp.getBoolean(R.string.pref_enable_analytics, R.bool.pref_true)) {
mTracker = EasyTracker.getInstance(this);
}
}
示例7: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.compose);
mApp = CatnutApp.getTingtingApp();
mActionBar = getActionBar();
mTitle = getString(R.string.compose);
mEmotionTitle = getString(R.string.add_emotions);
injectLayout();
injectActionBar();
injectListener();
handleOuterShare();
mActionBar.setIcon(R.drawable.ic_title_compose);
mActionBar.setTitle(mTitle);
mActionBar.setDisplayHomeAsUpEnabled(true);
mActionBar.setHomeButtonEnabled(true);
mInputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
if (mApp.getPreferences().getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
}
示例8: GoogleAnalyticsTracking
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
public GoogleAnalyticsTracking(Context context) {
mTracker = EasyTracker.getInstance(context);
Thread.UncaughtExceptionHandler uncaughtExceptionHandler =
Thread.getDefaultUncaughtExceptionHandler();
if (uncaughtExceptionHandler instanceof ExceptionReporter) {
ExceptionReporter exceptionReporter = (ExceptionReporter) uncaughtExceptionHandler;
exceptionReporter.setExceptionParser(new AnalyticsExceptionParser());
}
}
示例9: initializeEzTracker
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
private void initializeEzTracker() {
// May return null if a EasyTracker has not yet been initialized with a
// property ID.
try {
easyTracker = EasyTracker.getInstance(this);
ezTracker_NullFlag = (easyTracker == null ? true : false);
} catch (Exception ignored) {
ezTracker_NullFlag = true;
}
}
示例10: onStart
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onStart() {
super.onStart();
final Tracker tracker = EasyTracker.getInstance(getActivity());
tracker.set(Fields.SCREEN_NAME, "Recipe Details");
tracker.send(MapBuilder.createAppView().build());
}
示例11: sendAnalyticsModeClickEvent
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
private void sendAnalyticsModeClickEvent(String mode) {
EasyTracker easyTracker = EasyTracker.getInstance(activity);
easyTracker.send(MapBuilder
.createEvent("ui_action", // Event category (required)
"mode_click", // Event action (required)
mode, // Event label
null) // Event value
.build()
);
}
示例12: pushSettingChengedEvent
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
/**
* 設定変更をpushする.
*
* @param context {@link Context}
* @param key キー
* @param newValue 値
*/
public static void pushSettingChengedEvent(Context context, String key, Object newValue) {
Tracker tracker = EasyTracker.getInstance(context);
if (newValue != null && newValue instanceof Set) {
pushSettingChengedEvent(tracker, key, (Set<?>) newValue);
} else {
String newValueStr = newValue == null ? "nullpo" : String.valueOf(newValue);
tracker.send(MapBuilder.createEvent("settingChenged", key, newValueStr, null).build());
}
}
示例13: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
EasyTracker.getInstance(this);
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
if (uncaughtExceptionHandler instanceof ExceptionReporter) {
ExceptionReporter exceptionReporter = (ExceptionReporter) uncaughtExceptionHandler;
exceptionReporter.setExceptionParser(new AnalyticsExceptionParser());
}
mInstance = this;
}
示例14: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mApp = CatnutApp.getTingtingApp();
mActionBar = getActionBar();
mActionBar.setIcon(R.drawable.ic_title_home);
setContentView(R.layout.main);
// drawer specific
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
// mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
mDrawerLayout.setDrawerListener(this);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer, R.string.open_drawer, R.string.close_drawer);
// the whole left drawer
mQuickReturnDrawer = (QuickReturnScrollView) findViewById(R.id.drawer);
mQuickReturnDrawer.setCallbacks(this);
mQuickReturnView = findViewById(R.id.quick_return);
mPlaceholderView = findViewById(R.id.place_holder);
mQuickReturnDrawer.getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
onScrollChanged(mQuickReturnDrawer.getScrollY());
mMaxScrollY = mQuickReturnDrawer.computeVerticalScrollRange()
- mQuickReturnDrawer.getHeight();
mQuickReturnHeight = mQuickReturnView.getHeight();
}
}
);
// drawer customized view
mProfileCover = (ImageView) findViewById(R.id.avatar_profile);
mTextNick = (TextView) findViewById(R.id.nick);
mDescription = (TextView) findViewById(R.id.description);
prepareDrawer();
injectListeners();
if (savedInstanceState == null) {
HomeTimelineFragment fragment = HomeTimelineFragment.getFragment();
mCallbacks = fragment;
mRefreshCallback = fragment;
getFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container, fragment, HomeTimelineFragment.TAG)
.commit();
}
getFragmentManager().addOnBackStackChangedListener(this);
if (mApp.getPreferences().getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
}
示例15: onCreate
import com.google.analytics.tracking.android.EasyTracker; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
FragmentTransaction ft = getFragmentManager().beginTransaction();
mWhich = getIntent().getIntExtra(TAG, PREF);
Fragment fragment = null;
switch (mWhich) {
case PREF:
fragment = PrefFragment.getFragment();
break;
case PHOTO_VIEWER:
setTheme(R.style.Theme_Fantasy);
String picUrl = getIntent().getStringExtra(Constants.PIC);
fragment = PhotoViewerFragment.getFragment(picUrl);
break;
case DRAFT:
fragment = DraftFragment.getFragment();
break;
case FAVORITES:
fragment = FavoriteFragment.getFragment();
break;
case FRIENDS:
fragment = MyRelationshipFragment.getFragment(getIntent().getBooleanExtra(User.following, true));
break;
case USER_TWEETS:
long id = getIntent().getLongExtra(Constants.ID, 0L);
String screenName = getIntent().getStringExtra(User.screen_name);
fragment = UserTimelineFragment.getFragment(id, screenName);
break;
case AUTH:
fragment = new OAuthFragment();
break;
case GALLERY:
setTheme(R.style.Theme_Fantasy);
int index = getIntent().getIntExtra(GalleryPagerFragment.CUR_INDEX, 0);
ArrayList<Uri> uris = getIntent().getParcelableArrayListExtra(GalleryPagerFragment.URLS);
String title = getIntent().getStringExtra(GalleryPagerFragment.TITLE);
fragment = GalleryPagerFragment.getFragment(index, uris, title);
break;
case PLUGINS_PREF:
fragment = PluginsPrefFragment.getFragment();
break;
default:
// get out!
navigateUpTo(getIntent());
break;
}
if (fragment instanceof TimelineFragment) {
mCallbacks = (ConfirmBarController.Callbacks) fragment;
}
ft.replace(android.R.id.content, fragment).commit();
}
if (CatnutApp.getTingtingApp().getPreferences()
.getBoolean(getString(R.string.pref_enable_analytics), true)) {
mTracker = EasyTracker.getInstance(this);
}
getActionBar().setDisplayHomeAsUpEnabled(true);
}