Exemplo n.º 1
0
  //	private void initIsSharetosinaweiboBtn(){
  //	  String token = shellRW.getStringValue("token");
  //	  if(token.equals("")){
  //		  is_sharetosinaweibo.setBackgroundResource(R.drawable.off);
  //	  }else{
  //		  is_sharetosinaweibo.setBackgroundResource(R.drawable.on);
  //	  }
  //	}
  private void cancleAutoLogin() {
    pBar = UserCenterDialog.onCreateDialog(this, "取消中……");
    pBar.show();
    handler.post(
        new Runnable() {

          @Override
          public void run() {
            String userno = shellRW.getStringValue("userno");
            // TODO Auto-generated method stub
            String cancleBack = CancleAutoLoginInterface.cancelAutoLogin(userno);
            try {
              JSONObject netBack = new JSONObject(cancleBack);
              String errorCode = netBack.getString("error_code");
              String massage = netBack.getString("message");
              if (errorCode.equals("0000")) {
                auto_login_set.setBackgroundResource(R.drawable.off);
                shellRW.putBooleanValue(ShellRWConstants.AUTO_LOGIN, false);
                pBar.dismiss();
              } else {
                auto_login_set.setBackgroundResource(R.drawable.on);
                shellRW.putBooleanValue(ShellRWConstants.AUTO_LOGIN, true);
                pBar.dismiss();
              }
              Toast.makeText(MoreActivity.this, massage, Toast.LENGTH_SHORT).show();
            } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            } catch (RuntimeException e) {
              // TODO: handle exception
              e.printStackTrace();
            }
          }
        });
  }
Exemplo n.º 2
0
  /** 联网查询 */
  private void netting(final String orderBy, final String orderDi) {
    String str = "00";
    str =
        QueryJoinInfoInterface.queryLotJoinInfo(
            lotno,
            issue,
            orderBy,
            orderDir,
            "" + viewInfos[topIndex][lottypeIndex].newPage,
            JoinHallActivity.PAGENUM);
    handlerTwo.post(
        new Runnable() {
          @Override
          public void run() {
            progressbar.setVisibility(view.INVISIBLE);
            view.setEnabled(true);
          }
        });
    try {
      json = new JSONObject(str);
      String msg = json.getString("message");
      String error = json.getString("error_code");
      if (error.equals("0047") || error.equals("0407")) {
        handler.post(
            new Runnable() {

              @Override
              public void run() {
                // TODO Auto-generated method stub
                initList();
              }
            });
      }
      handler.handleMsg(error, msg);
    } catch (JSONException e) {
      e.printStackTrace();
    }
    if (viewInfos[topIndex][lottypeIndex].newPage == 0) {
      progressdialog.dismiss();
    }
  }