当前位置: 首页>>代码示例>>Java>>正文


Java EasyTracker.getInstance方法代码示例

本文整理汇总了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);
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:25,代码来源:ProfileActivity.java

示例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();
	}
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:25,代码来源:TweetActivity.java

示例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);
}
 
开发者ID:PhaniGaddipati,项目名称:Stacks-Flashcards,代码行数:19,代码来源:MainActivity.java

示例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);
}
 
开发者ID:groupsky,项目名称:android-recipes-app,代码行数:19,代码来源:RecipeItemListFragment.java

示例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);
	}
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:30,代码来源:PluginsActivity.java

示例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);
	}
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:14,代码来源:NoHistoryActivity.java

示例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);
	}
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:28,代码来源:ComposeTweetActivity.java

示例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());
    }
}
 
开发者ID:johnjohndoe,项目名称:Umweltzone,代码行数:11,代码来源:GoogleAnalyticsTracking.java

示例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;
	}
}
 
开发者ID:Austin-Liang,项目名称:OurDailyBread,代码行数:11,代码来源:DetailActivity.java

示例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());
}
 
开发者ID:groupsky,项目名称:android-recipes-app,代码行数:8,代码来源:RecipeItemDetailFragment.java

示例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()
    );
}
 
开发者ID:PavelKorolev,项目名称:liquid-bear-android,代码行数:11,代码来源:ModeClickListener.java

示例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());
    }
}
 
开发者ID:75py,项目名称:XUtilities,代码行数:17,代码来源:AnalyticsUtil.java

示例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;
}
 
开发者ID:Trolldad,项目名称:Reddit-Headlines,代码行数:12,代码来源:RedditHeadlinesApplication.java

示例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);
		}
	}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:57,代码来源:MainActivity.java

示例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);
}
 
开发者ID:missmisslonely,项目名称:fakeweibo,代码行数:60,代码来源:SingleFragmentActivity.java


注:本文中的com.google.analytics.tracking.android.EasyTracker.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。