Back to project page City-Outdoors-Android.
The source code is released under:
Copyright (c) 2012, Edinburgh Council All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are ...
If you think the Android project City-Outdoors-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.jarofgreen.cityoutdoors.UI; /* w w w . j av a 2s . c o m*/ import com.google.analytics.tracking.android.EasyTracker; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.view.View; /** * * @author James Baster <james@jarofgreen.co.uk> * @copyright City of Edinburgh Council & James Baster * @license Open Source under the 3-clause BSD License * @url https://github.com/City-Outdoors/City-Outdoors-Android */ public class BaseActivity extends Activity { private boolean analyticsEnabled = true; protected boolean isUserLoggedIn() { SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this); int userID = settings.getInt("userID", -1); if (userID > 0) { return true; } else { return false; } } public void onClickViewTAndC(View v) { startActivity(new Intent(this, TermsAndConditionsActivity.class)); } @Override public void onStart() { super.onStart(); SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this); analyticsEnabled = (settings.getString("analyticsEnabled", "yes").compareTo("yes") == 0); if (analyticsEnabled) EasyTracker.getInstance().activityStart(this); } @Override public void onStop() { super.onStop(); if (analyticsEnabled) EasyTracker.getInstance().activityStop(this); } }