private void onTopicSelected(String topic) {
    if (mSelectedTopic.equals(topic)) {
      return;
    }
    LOGD(TAG, "Topic selected: " + topic);
    VideoLibraryFragment frag =
        (VideoLibraryFragment)
            getFragmentManager()
                .findFragmentById(com.saarang.samples.apps.iosched.R.id.videos_fragment);
    if (frag == null) {
      LOGE(TAG, "Videos fragment not found.");
      return;
    }
    mSelectedTopic = topic;

    /* [ANALYTICS:EVENT]
     * TRIGGER:   Select a topic on the topics dropdown in the Video Library.
     * CATEGORY:  'Video Library'
     * ACTION:    selecttopic
     * LABEL:     year (e.g. "Android", "Chrome", ...)
     * [/ANALYTICS]
     */
    AnalyticsManager.sendEvent("Video Library", "selecttopic", topic, 0L);

    frag.setFilterAndReload(mSelectedYear, mSelectedTopic);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (isFinishing()) {
      return;
    }

    setContentView(com.saarang.samples.apps.iosched.R.layout.activity_video_library);

    mDrawShadowFrameLayout =
        (DrawShadowFrameLayout) findViewById(com.saarang.samples.apps.iosched.R.id.main_content);

    /* [ANALYTICS:SCREEN]
     * TRIGGER:   View the Video Library screen.
     * LABEL:     'Video Library'
     * [/ANALYTICS]
     */
    AnalyticsManager.sendScreenView(SCREEN_LABEL);
    LOGD("Tracker", SCREEN_LABEL);

    overridePendingTransition(0, 0);
    registerHideableHeaderView(findViewById(com.saarang.samples.apps.iosched.R.id.headerbar));

    if (savedInstanceState != null) {
      mYearToRestore = savedInstanceState.getInt(STATE_KEY_YEAR, 0);
      mTopicToRestore = savedInstanceState.getString(STATE_KEY_TOPIC, "");
    }
  }
  private void onYearSelected(int year) {
    if (mSelectedYear == year) {
      return;
    }
    LOGD(TAG, "Year selected: " + year);
    VideoLibraryFragment frag =
        (VideoLibraryFragment)
            getFragmentManager()
                .findFragmentById(com.saarang.samples.apps.iosched.R.id.videos_fragment);
    if (frag == null) {
      LOGE(TAG, "Videos fragment not found.");
      return;
    }
    mSelectedYear = year;

    /* [ANALYTICS:EVENT]
     * TRIGGER:   Select a year on the Years dropdown in the Video Library.
     * CATEGORY:  'Video Library'
     * ACTION:    selectyear
     * LABEL:     year (e.g. 2014, 2013, 2012)
     * [/ANALYTICS]
     */
    AnalyticsManager.sendEvent("Video Library", "selectyear", String.valueOf(year), 0L);

    frag.setFilterAndReload(mSelectedYear, mSelectedTopic);
  }