コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    memService = ServiceFactory.getService(MemberService.class);
    super.onCreate(savedInstanceState);

    Long humanId = this.getIntent().getLongExtra("humanId", -1L);
    final Human human = memService.getDao().getEntityById(humanId);
    final MemberDetailActivity that = this;
    if (human != null) {
      ((TextView) findViewById(R.id.member_detail_name)).setText(human.getName());
      ((TextView) findViewById(R.id.member_detail_addr))
          .setText(human.getAddress() == null ? human.getSignname() : human.getAddress());

      FineImgView iv = (FineImgView) findViewById(R.id.member_round_head);
      iv.setFao(FineImgView.getHeadImgFao());
      iv.setNeedSample(true);
      iv.setMaxWidth(DensityUtil.dip2px(this, 80));
      iv.setSrc(human.getHeadimage()); // "f984264aa7c89b48fc2d08a64c21bd08.jpg"

      SimpleVerticalField ht = (SimpleVerticalField) findViewById(R.id.member_human_type);
      if (human.getSftype() != null) {
        String sfName = CodeService.getCodeService().getValue("humanType", human.getSftype());
        if (ht != null) ht.setValue(sfName);
      }
      /* SimpleVerticalField btnField = (SimpleVerticalField)findViewById(R.id.member_guid);
      btnField.setValue(human.getGuid());*/
      SimpleVerticalField btnField = (SimpleVerticalField) findViewById(R.id.member_tel_btn);
      btnField.setValue(human.getMobile());
      // 保持上面四行代码的顺序,为了让下面的单击事件监听手机号码项/lxy
      btnField.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              AppHelper.callTel(that, human.getMobile());
            }
          });

      findViewById(R.id.member_sms_btn)
          .setOnClickListener(
              new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                  AppHelper.startSMSMessage(that, human.getMobile(), "你好");
                }
              });
    }
  }
コード例 #2
0
 @Override
 protected void initActionBar(ActionBar actionBar) {
   super.initActionBar(actionBar);
   actionBar.setIcon(com.mfh.comna.R.drawable.white_logo);
 }