示例#1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main2);

    int num = getIntent().getExtras().getInt("num");

    TextView tv = (TextView) findViewById(R.id.textView);

    tracker = GoogleAnalyticsTracker.getInstance();
    tracker.start("UA-24434459-1", 5, this);

    // セッション
    //        tracker.setCustomVar(2, "SecondActivity", "During Visit",3);
    // ページビュー
    tracker.trackPageView("/SecondAcivity");

    if (num == 1) {
      tv.setText("海が荒ぶる");
    } else if (num == 2) {
      tv.setText("魔法少女の特急便");
    } else {
      tv.setText("ゲド電気");
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mUri = getIntent().getData();
    setContentView(R.layout.notifying_controller);

    Button button = (Button) findViewById(R.id.notifyStart);
    button.setOnClickListener(mStartListener);
    button = (Button) findViewById(R.id.notifyStop);
    button.setVisibility(Button.INVISIBLE);
    button.setOnClickListener(mStopListener);

    tracker = GoogleAnalyticsTracker.getInstance();

    // Start the tracker in manual dispatch mode...
    tracker.start(NonPublicConstants.NONPUBLIC_GOOGLE_ANALYTICS_UA_ACCOUNT_CODE, 20, this);
    SharedPreferences prefs =
        getSharedPreferences(PreferenceConstants.PREFERENCE_NAME, MODE_PRIVATE);
    mAuBlogInstallId = prefs.getString(PreferenceConstants.AUBLOG_INSTALL_ID, "0");

    tracker.trackEvent(
        mAuBlogInstallId, // Category
        "Notifications", // Action
        "User found the notification controller by clicking on the recording notification. "
            + System.currentTimeMillis()
            + " : "
            + mAuBlogInstallId, // Label
        (int) System.currentTimeMillis()); // Value
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // init
    activity = this;
    res = this.getResources();
    app = (cgeoapplication) this.getApplication();
    settings = new cgSettings(this, getSharedPreferences(cgSettings.preferences, 0));
    base = new cgBase(app, settings, getSharedPreferences(cgSettings.preferences, 0));
    warning = new cgWarning(this);

    // set layout
    if (settings.skin == 1) {
      setTheme(R.style.light);
    } else {
      setTheme(R.style.dark);
    }
    setContentView(R.layout.waypoint);
    base.setTitle(activity, "waypoint");

    // google analytics
    tracker = GoogleAnalyticsTracker.getInstance();
    tracker.start(cgSettings.analytics, this);
    tracker.dispatch();
    base.sendAnal(activity, tracker, "/waypoint/detail");

    // get parameters
    Bundle extras = getIntent().getExtras();

    // try to get data from extras
    if (extras != null) {
      id = extras.getInt("waypoint");
      geocode = extras.getString("geocode");
    }

    if (id <= 0) {
      warning.showToast(res.getString(R.string.err_waypoint_unknown));
      finish();
      return;
    }

    if (geo == null) {
      geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0);
    }

    waitDialog = ProgressDialog.show(this, null, res.getString(R.string.waypoint_loading), true);
    waitDialog.setCancelable(true);

    (new loadWaypoint()).start();
  }