Example #1
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      Intent in = new Intent(this, SettingsActivity.class);
      startActivity(in);
      return true;
    } else if (id == R.id.action_logout) {
      AppToServer.doLogout(this);
      return true;
    } else if (id == R.id.action_changeDP) {
      takePictureFromCamera();
    } else if (id == R.id.action_changeNname) {
      changeNickName();
    } else if (id == R.id.action_changePwd) {
      changePassword();
    } else if (id == R.id.action_showDP) {
      ImageActivity.startMe(
          this,
          AdditionalFunctions.getDP_URL(AppToServer.getId(), false),
          AppToServer.getNickName());
    }

    return super.onOptionsItemSelected(item);
  }
Example #2
0
 @Override
 public void onClick(View v) {
   Integer id;
   if ((id = (Integer) v.getTag()) != null) {
     int otherPosInlist = AppToServer.getAllUserId().indexOf(id);
     if (otherPosInlist >= 0) {
       ImageActivity.startMe(
           context,
           AdditionalFunctions.getDP_URL(id, false),
           AppToServer.getAllUserNname().get(otherPosInlist));
     }
   }
 }