protected void onCreate()

in todoapp/app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsActivity.java [37:65]


  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.statistics_act);

    // Set up the toolbar.
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar ab = getSupportActionBar();
    ab.setTitle(R.string.statistics_title);
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);

    // Set up the navigation drawer.
    mDrawerLayout = findViewById(R.id.drawer_layout);
    mDrawerLayout.setStatusBarBackground(R.color.colorPrimaryDark);
    NavigationView navigationView = findViewById(R.id.nav_view);
    if (navigationView != null) {
      setupDrawerContent(navigationView);
    }

    StatisticsFragment statisticsFragment =
        (StatisticsFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);
    if (statisticsFragment == null) {
      statisticsFragment = StatisticsFragment.newInstance();
      ActivityUtils.addFragmentToActivity(
          getSupportFragmentManager(), statisticsFragment, R.id.contentFrame);
    }
  }