@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setIcon(android.R.color.transparent);
    actionBar.setLogo(R.drawable.up_icon);
    actionBar.setTitle(R.string.observation_photos);

    mApp = (INaturalistApp) getApplicationContext();
    setContentView(R.layout.observation_photos);

    Intent intent = getIntent();

    try {
      if (savedInstanceState == null) {
        String observationString = intent.getStringExtra("observation");
        if (observationString != null) mObservation = new JSONObject(observationString);
      } else {
        mObservation = new JSONObject(savedInstanceState.getString("observation"));
      }
    } catch (JSONException e) {
      e.printStackTrace();
    }

    mViewPager = (HackyViewPager) findViewById(R.id.id_pic_view_pager);
    if (mObservation != null) {
      mViewPager.setAdapter(new IdPicsPagerAdapter(mObservation));
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle myextras = getIntent().getExtras();
    contextualGDS = (GruppoDiStudio) myextras.getSerializable(Constants.GDS_SUBS);

    // questo carica la materia nel gruppo
    new GetRelatedCorsoAS(GDS_members_activity.this, contextualGDS).execute();

    setContentView(R.layout.gds_members_activity);
    // customize layout
    ActionBar actionbar = getSupportActionBar();
    actionbar.setTitle(getResources().getString(R.string.gds_show_users));
    actionbar.setLogo(R.drawable.gruppistudio_icon_white);
    actionbar.setHomeButtonEnabled(true);
    actionbar.setDisplayHomeAsUpEnabled(true);

    // retrieving graphics from activity_layout
    TextView nome_gds = (TextView) findViewById(R.id.tv_nome_gds_detail_members);
    TextView materia_gds = (TextView) findViewById(R.id.tv_materia_gds_detail_members);
    ListView participants_gds = (ListView) findViewById(R.id.lv_partecipanti_gds_members);

    nome_gds.setText(contextualGDS.getNome());
    materia_gds.setText(contextualGDS.getMateria());

    if (contextualGDS.getStudentiGruppo() != null && !contextualGDS.getStudentiGruppo().isEmpty()) {
      Students_to_listview_adapter adapter =
          new Students_to_listview_adapter(
              GDS_members_activity.this,
              R.id.lv_partecipanti_gds_members,
              ((ArrayList<Studente>) contextualGDS.getStudentiGruppo()));
      participants_gds.setAdapter(adapter);
    }
  }
Пример #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.regist_page2);
    // start header
    ActionBar bar = getSupportActionBar();
    bar.setBackgroundDrawable(getResources().getDrawable(R.drawable.actionbar_bitmap));
    bar.setLogo(R.drawable.logoicon);
    bar.setCustomView(R.layout.header);
    bar.setDisplayShowCustomEnabled(true);
    bar.setDisplayHomeAsUpEnabled(true);
    titlebar_text = (TextView) findViewById(R.id.titlebar_text);
    titlebar_text.setText("기본정보 입력");
    // end header

    member_name_edit_text = (EditText) findViewById(R.id.member_name_edit_text);
    member_phone_num_edit_text = (EditText) findViewById(R.id.member_phone_num_edit_text);

    Intent in = getIntent();
    email = in.getStringExtra("email");
    password = in.getStringExtra("password");

    user_img = (ImageView) findViewById(R.id.member_img);

    user_img.setOnClickListener(
        new ImageView.OnClickListener() {
          @Override
          public void onClick(View v) {
            {
              DialogInterface.OnClickListener cameraListener =
                  new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      doTakePhotoAction();
                    }
                  };

              DialogInterface.OnClickListener albumListener =
                  new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      doTakeAlbumAction();
                    }
                  };

              DialogInterface.OnClickListener cancelListener =
                  new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      dialog.dismiss();
                    }
                  };

              new AlertDialog.Builder(Register2Activity.this)
                  .setTitle("select the image")
                  .setPositiveButton("take picture", cameraListener)
                  .setNeutralButton("album", albumListener)
                  .setNegativeButton("cancel", cancelListener)
                  .show();
            }
          }
        });

    super.onCreate(savedInstanceState);
  }