Ejemplo n.º 1
0
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    if (resultCode != RESULT_OK) {
      return;
    }

    if (requestCode == 0) {
      try {

        final String str;
        Uri localUri = data.getData();
        String[] arrayOfString = new String[1];
        arrayOfString[0] = "_data";
        Cursor localCursor = getContentResolver().query(localUri, arrayOfString, null, null, null);
        if (localCursor == null) return;
        localCursor.moveToFirst();
        str = localCursor.getString(localCursor.getColumnIndex(arrayOfString[0]));
        localCursor.close();
        showModifyHead(str);
      } catch (Exception e) {
        e.printStackTrace();
      }

    } else if (requestCode == 1) {
      try {
        String path = PhotoUtils.getPicPathFromUri(PhotoUtils.imageFileUri, this);
        showModifyHead(path);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    super.onActivityResult(requestCode, resultCode, data);
  }
Ejemplo n.º 2
0
 private void getperBg() {
   if (bgBitmap == null) {
     bgBitmap = PhotoUtils.getListHeadBg();
     if (null != bgBitmap) {
       headbg.setImageBitmap(bgBitmap);
     }
   } else {
     headbg.setImageBitmap(bgBitmap);
   }
 }
Ejemplo n.º 3
0
        @Override
        public void onClick(View v) {
          // TODO Auto-generated method stub
          switch (v.getId()) {
            case R.id.userhead:
              showUserHead();
              break;
            case R.id.user_info_lay:
              PhotoUtils.secPic(context);
              break;

            case R.id.niname_lay:
              showModifyName();
              break;

            case R.id.sex_lay:
              showModifySex();
              break;

            case R.id.age_lay:
              showModifyAge();
              break;

            case R.id.height_lay:
              showModifyHeight();
              break;

            case R.id.weight_lay:
              showModifyWeight();
              break;

            case R.id.bmi_lay:
              ShowBmiDialog.showBmi(context);
              break;

            case R.id.carre_lay:
              showModifyCareer();
              break;

            case R.id.body_state_lay:
              showModifyBodyState();
              break;
            case R.id.body_remark_lay:
              showModifyRemark();
              break;

            default:
              break;
          }
        }