private void initData() {
   String oldpwdText = oldpwd.getText().toString();
   String newpwdText = newpwd.getText().toString();
   RequstClient.appUpdateCardPwd(
       AppContext.getInstance().userId,
       AppContext.getInstance().mUserInfo.cardNum,
       oldpwdText,
       newpwdText,
       new CustomResponseHandler(this) {
         @Override
         public void onSuccess(int statusCode, Header[] headers, String content) {
           super.onSuccess(statusCode, headers, content);
           try {
             JSONObject obj = new JSONObject(content);
             if (!obj.getString("type").equals("1")) {
               String errorMsg = obj.getString("msg");
               Toast.makeText(getBaseContext(), errorMsg, Toast.LENGTH_SHORT).show();
               return;
             }
             Toast.makeText(getBaseContext(), "修改成功", Toast.LENGTH_SHORT).show();
             finish();
           } catch (Exception e) {
             e.printStackTrace();
           }
         }
       });
 }
Пример #2
0
  private void baiduPushInfo(Intent intent) {
    if (intent == null) {
      stopSelf();
      return;
    }
    String channelId = intent.getStringExtra("channelId");
    String bdUserId = intent.getStringExtra("bdUserId");
    String userId = AppContext.getInstance().userId;
    if (TextUtils.isEmpty(userId)) {
      stopSelf();
      return;
    }
    MyCustomResponseHandler mHandler =
        new MyCustomResponseHandler(BindUserIdServer.this, false) {
          @Override
          public void onSuccess(int statusCode, Header[] headers, String content) {
            super.onSuccess(statusCode, headers, content);
            Gson gson = new Gson();
            BaseBean bean = gson.fromJson(content, BaseBean.class);
            if (bean != null && bean.type > 0) {}

            LogUtil.d("BindUserIdServer", "content:" + content);
            stopSelf();
          }
        };
    RequstClient.baiduPushInfo(mHandler, channelId, bdUserId, userId);
  }
  @SuppressWarnings("static-access")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.apply_service_card_layout);
    mContext = this;
    userId = AppContext.getInstance().userId;
    findView();
    setListener();

    cardNum = getIntent().getStringExtra("cardNum");
    cardPwd = getIntent().getStringExtra("cardPwd");

    card_num.setText(cardNum);
    card_password.setText(cardPwd);
  }