Exemplo n.º 1
0
  private void setContactInfo(String content) {
    final FeedbackAgent fb = new FeedbackAgent(mContext);
    UserInfo userInfo = fb.getUserInfo();
    if (userInfo == null) {
      userInfo = new UserInfo();
    }
    Map<String, String> contact = userInfo.getContact();
    if (contact == null || contact.isEmpty()) {
      contact = new HashMap<String, String>();
    }
    int position = spContactType.getSelectedItemPosition();
    contact.put(keys[position], content);
    userInfo.setContact(contact);
    fb.setUserInfo(userInfo);

    new Thread(
            new Runnable() {
              @Override
              public void run() {
                fb.updateUserInfo();
              }
            })
        .start();
    types[position] = content;
    showContactInfo();
  }
Exemplo n.º 2
0
 public void sendInfoToUmeng(String content) {
   String contact =
       currentAccount.getPhone() == null ? currentAccount.getEmail() : currentAccount.getPhone();
   UserInfo info = new UserInfo();
   Map<String, String> map = info.getContact();
   if (map == null) map = new HashMap<String, String>();
   map.put("plain", contact);
   info.setContact(map);
   agent.setUserInfo(info);
   defaultConversation = agent.getDefaultConversation();
   defaultConversation.addUserReply(content);
   defaultConversation.sync(this);
 }
Exemplo n.º 3
0
 private void getContactInfo() {
   UserInfo userInfo = new FeedbackAgent(mContext).getUserInfo();
   if (userInfo == null) {
     LogUtil.i("contact", "user_null");
     tvContactHint.setText(R.string.add_contact_info);
     tvContactInfo.setText(R.string.leave_contact_info_hint);
     userInfo = new UserInfo();
   } else {
     Map<String, String> contact = userInfo.getContact();
     LogUtil.i("contact", contact.toString());
     if (contact == null || contact.isEmpty()) {
       LogUtil.i("contact", "contact_null");
       tvContactHint.setText(R.string.add_contact_info);
       tvContactInfo.setText(R.string.leave_contact_info_hint);
       contact = new HashMap<String, String>();
     } else {
       for (int i = 0; i <= 3; i++) {
         types[i] = contact.get(keys[i]);
       }
       showContactInfo();
     }
   }
 }