Esempio n. 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mDrawerFragment =
        (DrawerFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
    mDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout));
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    ItemSection.Questionnaire questionnaire =
        (ItemSection.Questionnaire) intent.getSerializableExtra("questionnaire_name");
    switch (questionnaire) {
      case NURSE:
        sections = DataSource.nurseSections();
        break;
      case EVALUATOR:
        sections = DataSource.evaluatorSections();
        break;
      case PHYSICAL:
        sections = DataSource.physicalSections();
        break;
      case SOCIO:
        sections = DataSource.socioSections();
        break;
    }
    setContentView(R.layout.activity_questionnaire);

    context = this;
    mNavigationDrawerFragment =
        (DrawerFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
    mTitle = getTitle();

    // Set up the drawer.
    mNavigationDrawerFragment.setUp(
        R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout));

    containerLayout = (FrameLayout) findViewById(R.id.container);

    sectionNumber = 0;
    questionNumber = 0;

    loadQuestion(sectionNumber, questionNumber);
  }