Back to project page sthlmtraveling.
The source code is released under:
Apache License
If you think the Android project sthlmtraveling 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 com.markupartist.sthlmtraveling; //from w w w .j ava 2s . c o m import android.content.Intent; import android.os.Bundle; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockActivity; import com.actionbarsherlock.view.MenuItem; import com.flurry.android.FlurryAgent; import com.markupartist.sthlmtraveling.utils.Analytics; import java.util.Map; public class BaseActivity extends SherlockActivity { @Override protected void onStart() { super.onStart(); FlurryAgent.onStartSession(this, MyApplication.ANALYTICS_KEY); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FlurryAgent.onPageView(); } @Override protected void onStop() { super.onStop(); FlurryAgent.onEndSession(this); } protected ActionBar initActionBar() { ActionBar actionBar = getSupportActionBar(); actionBar.setHomeButtonEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setDisplayShowHomeEnabled(true); return actionBar; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: final Intent startIntent = new Intent(this, StartActivity.class); startIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(startIntent); return true; } return super.onOptionsItemSelected(item); } protected void registerScreen(String event) { FlurryAgent.onEvent(event); Analytics.getInstance(this).registerScreen(event); } protected void registerEvent(String event, Map<String, String> parameters) { FlurryAgent.onEvent(event, parameters); } }