// 支付宝充值
  private void beginAlipayRecharge(View Vi) { // isWebView = false代表浏览器联网
    String zfb_recharge_value_string = accountnum.getText().toString();
    RWSharedPreferences pre = new RWSharedPreferences(AlipaySecureActivity.this, "addInfo");
    String sessionIdStr = pre.getStringValue(ShellRWConstants.SESSIONID);
    phonenum = pre.getStringValue(ShellRWConstants.PHONENUM);

    if (sessionIdStr.equals("") || sessionIdStr == null) {
      Intent intentSession = new Intent(AlipaySecureActivity.this, UserLogin.class);
      startActivity(intentSession);
    } else {
      if (zfb_recharge_value_string.equals("0")) {
        Toast.makeText(this, "不能为0!", Toast.LENGTH_LONG).show();
        return;
      }
      if (zfb_recharge_value_string.equals("") || zfb_recharge_value_string.length() == 0) {
        Toast.makeText(this, "不能为空!", Toast.LENGTH_LONG).show();
      } else {
        // 支付宝充值网络获取
        // 改为线程 2010/7/9陈晨
        RechargePojo rechargepojo = new RechargePojo();
        ;
        rechargepojo.setAmount(zfb_recharge_value_string);
        rechargepojo.setRechargetype("05");
        rechargepojo.setCardtype("0300");

        if (isWebView) {
          rechargepojo.setBankAccount("4"); // 4支付宝wap支付
        } else {
          rechargepojo.setBankAccount("3"); // 3支付宝浏览器支付
        }
        recharge(rechargepojo);
      }
    }
  }
예제 #2
0
 public void isTurnView() {
   RWSharedPreferences shellRW =
       new RWSharedPreferences(AccountYingActivity.this, ShellRWConstants.SHAREPREFERENCESNAME);
   String userno = shellRW.getStringValue(ShellRWConstants.USERNO);
   String phonenum = shellRW.getStringValue(ShellRWConstants.PHONENUM);
   String accountnumstr = accountnum.getText().toString();
   if (accountnumstr.length() > 9) {
     Toast.makeText(AccountYingActivity.this, "你有那么多钱吗?", Toast.LENGTH_SHORT).show();
     accountnum.setText("100");
     isOnClick = true;
   } else if (accountnumstr.equals("")) {
     Toast.makeText(AccountYingActivity.this, "请输入充值金额!", Toast.LENGTH_SHORT).show();
     isOnClick = true;
   } else if (Integer.parseInt(accountnumstr) == 0) {
     Toast.makeText(AccountYingActivity.this, "充值金额不能为0!", Toast.LENGTH_SHORT).show();
     isOnClick = true;
   } else if (Integer.parseInt(accountnumstr) < 20) {
     Toast.makeText(AccountYingActivity.this, "充值金额至少为20元!", Toast.LENGTH_SHORT).show();
     isOnClick = true;
   } else {
     if (isAlipay) {
       isInstallSecurePay(userno, phonenum, accountnumstr);
     } else {
       actoinYin(accountnumstr);
     }
   }
 }
예제 #3
0
        @Override
        public void onClick(View v) {
          // TODO Auto-generated method stub
          RWSharedPreferences pre = new RWSharedPreferences(context, "addInfo");
          context.sessionId = pre.getStringValue("sessionid");
          context.phonenum = pre.getStringValue("phonenum");
          context.userno = pre.getStringValue("userno");
          if (context.userno == null || context.userno.equals("")) {
            Intent intentSession = new Intent(context, UserLogin.class);
            context.startActivityForResult(intentSession, 0);
          } else if (zhuShu == 0) {
            Toast.makeText(context, "请选择过关方式", Toast.LENGTH_SHORT).show();
          } else {

            if (isAmtDialog()) {
              alertInfo(
                  context.getString(R.string.jc_main_touzhu_alert_text_content),
                  context.getString(R.string.jc_main_touzhu_alert_text_title));
            } else {
              switch (v.getId()) {
                case R.id.alert_dialog_touzhu_button_cancel:
                  initBet();
                  context.toJoinActivity();
                  break;
                case R.id.alert_dialog_touzhu_button_ok:
                  beginTouzhu();
                  break;
              }
              dialog.cancel();
            }
          }
        }
예제 #4
0
 /** 对合买对象进行赋值 */
 public void setPojo() {
   RWSharedPreferences pre = new RWSharedPreferences(JoinStartActivity.this, "addInfo");
   sessionId = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   betAndGift.setBettype("startcase");
   betAndGift.setTotalAmt(betAndGift.getAmount());
   if (betAndGift.getIssuper().equals("0")) {
     betAndGift.setOneAmount("300");
   } else {
     betAndGift.setOneAmount("200");
   }
   betAndGift.setSafeAmt(isNull(PublicMethod.toFen(isNull(safeEdit.getText().toString()))));
   betAndGift.setBuyAmt(isNull(PublicMethod.toFen(isNull(buyEdit.getText().toString()))));
   betAndGift.setMinAmt(PublicMethod.toFen(isNull(minEdit.getText().toString())));
   betAndGift.setCommisionRation(commisionRation);
   betAndGift.setVisibility(visible);
   betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno()));
   betAndGift.setDescription(descriptionEdit.getText().toString());
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti    倍数   投注的倍数
   betAndGift.setBatchnum("" + iProgressQishu); // batchnum    追号期数 默认为1(不追号)
   betAndGift.setAmount("" + ZixuanActivity.addView.getAllAmt() * iProgressBeishu * 100);
   betAndGift.setIsSellWays("1");
   betAndGift.setBet_code(
       ZixuanActivity.addView.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
 }
 private void bettingOrCooperation(boolean isBetting) {
   RWSharedPreferences pre =
       new RWSharedPreferences(BeiJingSingleGameIndentActivity.this, "addInfo");
   sessionId = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   if (bettingNum == 0) {
     Toast.makeText(BeiJingSingleGameIndentActivity.this, "请选择过关方式", Toast.LENGTH_SHORT).show();
   } else {
     if (userno == null || userno.equals("")) {
       Intent intentSession = new Intent(BeiJingSingleGameIndentActivity.this, UserLogin.class);
       BeiJingSingleGameIndentActivity.this.startActivityForResult(intentSession, 0);
     } else {
       if (isOutMaxAmt()) {
         alertInfo(
             BeiJingSingleGameIndentActivity.this.getString(
                 R.string.jc_main_touzhu_alert_text_content),
             BeiJingSingleGameIndentActivity.this.getString(
                 R.string.jc_main_touzhu_alert_text_title));
       } else {
         initBettingInfo();
         if (isBetting) {
           Betting();
         } else {
           turnToCooperation();
         }
       }
     }
   }
 }
예제 #6
0
  private void dialogMsg() {
    RWSharedPreferences shellRW = new RWSharedPreferences(BuyActivity.this, "UserMessage");
    messageflage = shellRW.getStringValue("tanchumessage");
    messageidflag = shellRW.getStringValue("id");
    if (!PublicConst.MESSAGE.equals("")) {
      try {
        obj = new JSONObject(PublicConst.MESSAGE);
        String id = obj.getString("id");
        messagetitle = obj.getString("title");
        messagedetail = obj.getString("message");
        if (messageidflag == null) {
          shellRW.putStringValue("id", id);
          Message msg = new Message();
          msg.what = 4;
          handler.sendMessage(msg);
        } else if (!messageidflag.equals(id)) {
          shellRW.putStringValue("id", id);
          Message msg = new Message();
          msg.what = 4;
          handler.sendMessage(msg);
        }

      } catch (JSONException e) {

      }
    }
  }
예제 #7
0
  private void isAgencyNet() {
    RWSharedPreferences pre = new RWSharedPreferences(this, "addInfo");
    String userno = pre.getStringValue(ShellRWConstants.USERNO);
    String phonenum = pre.getStringValue(ShellRWConstants.PHONENUM);
    String toPhonenum = userName.getText().toString();
    String amout = userAmt.getText().toString();
    String password = userPassword.getText().toString();

    if (toPhonenum == null || toPhonenum.equals("")) {
      Toast.makeText(context, "您输入的用户名不能为空!", Toast.LENGTH_SHORT).show();
    } else if (amout == null || amout.equals("")) {
      Toast.makeText(context, "您输入的金额不能为空!", Toast.LENGTH_SHORT).show();
    } else if (password == null || password.equals("")) {
      Toast.makeText(context, "您输入的密码不能为空!", Toast.LENGTH_SHORT).show();
    } else if (Integer.parseInt(amout.substring(0, 1)) == 0) {
      Toast.makeText(context, "您输入的金额第一位数不能为零", Toast.LENGTH_SHORT).show();
    } else if (amout.length() > 5) {
      Toast.makeText(context, "您输入的金额不能超过10万元!", Toast.LENGTH_SHORT).show();
    } else if (Integer.parseInt(amout) == 0) {
      Toast.makeText(context, "您输入的金额不能为零!", Toast.LENGTH_SHORT).show();
    } else {
      amout = PublicMethod.toFen(amout);
      agencyNet(userno, phonenum, toPhonenum, amout, password);
    }
  }
예제 #8
0
 private void oauthOrShare() {
   token = shellRW.getStringValue("token");
   expires_in = shellRW.getStringValue("expires_in");
   if (token.equals("")) {
     oauth();
   } else {
     isSinaTiaoZhuan = true;
     initAccessToken(token, expires_in);
   }
 }
  //
  // 投注新接口 20100711陈晨
  protected String[] payNew(String betCode, String lotMulti, String amount, String qiShu) {
    String[] error_code = null;
    //		BettingInterface betting = BettingInterface.getInstance();

    RWSharedPreferences shellRW = new RWSharedPreferences(this, "addInfo");
    String sessionid = shellRW.getStringValue("sessionid");
    String phonenum = shellRW.getStringValue("phonenum");
    //			error_code = betting.BettingTC(phonenum, qihaoxinxi[2], betCode, lotMulti,
    //					amount, "2", qiShu, sessionid, batchCode);

    return error_code;
  }
예제 #10
0
 /** 判断是否登陆 */
 public void isLogin() {
   RWSharedPreferences shellRW = new RWSharedPreferences(this, "addInfo");
   phonenum = shellRW.getStringValue("phonenum");
   sessionid = shellRW.getStringValue("sessionid");
   certid = shellRW.getStringValue("certid");
   name = shellRW.getStringValue("name");
   mobileid = shellRW.getStringValue("mobileid");
   if (sessionid == null || sessionid.equals("")) {
     Intent intentSession = new Intent(this, UserLogin.class);
     startActivityForResult(intentSession, 0);
   } else {
     userCenterDetail();
   }
 }
예제 #11
0
  // 充值
  private void recharge(final RechargePojo rechargepojo) {
    RWSharedPreferences pre = new RWSharedPreferences(AccountYingActivity.this, "addInfo");
    final String sessionId = pre.getStringValue(ShellRWConstants.SESSIONID);
    final String userno = pre.getStringValue(ShellRWConstants.USERNO);
    mProgress = UserCenterDialog.onCreateDialog(AccountYingActivity.this);
    mProgress.show();
    final Handler handler = new Handler();
    new Thread(
            new Runnable() {
              @Override
              public void run() {
                // TODO Auto-generated method stub
                try {
                  rechargepojo.setSessionid(sessionId);
                  rechargepojo.setUserno(userno);
                  String re = RechargeInterface.getInstance().recharge(rechargepojo);

                  JSONObject obj = new JSONObject(re);
                  String error_code = obj.getString("error_code");
                  final String message = obj.getString("message");
                  closeProgress();
                  if (error_code.equals("0000")) {
                    final String xml = obj.getString("value");
                    handler.post(
                        new Runnable() {
                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            turnYinView(xml);
                          }
                        });
                  } else {
                    handler.post(
                        new Runnable() {
                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            Toast.makeText(AccountYingActivity.this, message, Toast.LENGTH_SHORT);
                          }
                        });
                  }
                } catch (JSONException e) {
                  e.printStackTrace();
                }
              }
            })
        .start();
  }
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
      convertView = mInflater.inflate(R.layout.caizhong_setting_list_item, null);
      holder = new ViewHolder();
      holder.caizhongTextView = (TextView) convertView.findViewById(R.id.caizhong_TextView);
      holder.caizhongButton = (Button) convertView.findViewById(R.id.caizhong_set_checkbox);
      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
    }

    holder.caizhongTextView.setText(list.get(position).get("shellName"));
    for (int i = 0; i < list.size(); i++) {
      if (shellRW
          .getStringValue(list.get(position).get("shellKey"))
          .equals(Constants.CAIZHONG_OPEN)) {
        holder.caizhongButton.setBackgroundResource(R.drawable.on);
        holder.caizhongButton.setTag(
            R.id.caizhong_set_checkbox, list.get(position).get("shellKey"));
      } else {
        holder.caizhongButton.setBackgroundResource(R.drawable.off);
        holder.caizhongButton.setTag(
            R.id.caizhong_set_checkbox, list.get(position).get("shellKey"));
      }
    }
    holder.caizhongButton.setOnClickListener(onClickListener);
    return convertView;
  }
예제 #13
0
 /** 设置开机图片 */
 public void initImgView() {
   imageview = (ImageView) this.findViewById(R.id.cp1);
   File sdcardDir = Environment.getExternalStorageDirectory();
   String path = sdcardDir.getParent() + "/" + sdcardDir.getName();
   // 得到开机图片
   Bitmap bitmap = BitmapFactory.decodeFile(path + DownLoadImg.LOCAL_DIR + DownLoadImg.IMG_NAME);
   String errorCode = shellRW.getStringValue("errorCode");
   if (bitmap == null || errorCode.equals("") || errorCode.equals("false")) {
     Resources r = this.getResources();
     InputStream is = r.openRawResource(R.drawable.cp1);
     BitmapDrawable bmpDraw = new BitmapDrawable(is);
     bitmap = bmpDraw.getBitmap();
   }
   // 缩放开机图片
   Matrix matrix = new Matrix();
   float iScreenWidth = PublicMethod.getDisplayWidth(this);
   float iScreenHeight = PublicMethod.getDisplayHeight(this);
   float w = iScreenWidth / bitmap.getWidth();
   float h = iScreenHeight / bitmap.getHeight();
   if (w != 1 || h != 1) {
     matrix.postScale(w, h);
     bitmap =
         Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
   }
   imageview.setImageBitmap(bitmap);
 }
예제 #14
0
 /** @param rechargepojo */
 private void getAccountNet() {
   RWSharedPreferences pre = new RWSharedPreferences(AccountYingActivity.this, "addInfo");
   final String phonenum = pre.getStringValue(ShellRWConstants.PHONENUM);
   final String userno = pre.getStringValue(ShellRWConstants.USERNO);
   mProgress = UserCenterDialog.onCreateDialog(AccountYingActivity.this);
   mProgress.show();
   final Handler handler = new Handler();
   new Thread(
           new Runnable() {
             @Override
             public void run() {
               // TODO Auto-generated method stub
               try {
                 String re =
                     AccountRechargeInterface.getInstance().recharge(userno, phonenum, TYPE);
                 final JSONObject obj = new JSONObject(re);
                 String error_code = obj.getString("error_code");
                 final String message = obj.getString("message");
                 closeProgress();
                 if (error_code.equals("0000")) {
                   final JSONArray jsonArray = obj.getJSONArray("result");
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           initNameSpinner(getList(jsonArray));
                         }
                       });
                 } else {
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           Toast.makeText(AccountYingActivity.this, message, Toast.LENGTH_SHORT)
                               .show();
                         }
                       });
                 }
               } catch (JSONException e) {
                 e.printStackTrace();
               }
             }
           })
       .start();
 }
 /** DNA充值账户绑定查询 */
 public void checkDNA() {
   RWSharedPreferences pre = new RWSharedPreferences(AccountWithdrawActivity.this, "addInfo");
   final String sessionId = pre.getStringValue("sessionid");
   final String mobile = pre.getStringValue("mobileid");
   final String userno = pre.getStringValue("userno");
   if (sessionId == null || sessionId.equals("")) {
     Intent intentSession = new Intent(AccountWithdrawActivity.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
   } else {
     showDialog(0);
     new Thread(
             new Runnable() {
               @Override
               public void run() {
                 String error_code = "00";
                 String message = "";
                 try {
                   re = QueryDNAInterface.getInstance().queryDNA(mobile, sessionId, userno);
                   JSONObject obj = new JSONObject(re);
                   error_code = obj.getString("error_code");
                   message = obj.getString("message");
                 } catch (Exception e) {
                   e.printStackTrace();
                 }
                 if (error_code.equals("0047")) {
                   handler.post(
                       new Runnable() {
                         public void run() {
                           setContentView(getMoneyDialog());
                         }
                       });
                 } else if (error_code.equals("0000")) {
                   handler.post(
                       new Runnable() {
                         public void run() {
                           dialogDNA(re);
                         }
                       });
                 } else {
                   handler.handleMsg(error_code, message);
                 }
                 progressdialog.dismiss();
               }
             })
         .start();
   }
 }
예제 #16
0
 /** 投注方法 */
 private void beginTouZhu() {
   RWSharedPreferences pre = new RWSharedPreferences(GiftActivity.this, "addInfo");
   sessionId = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   String alertStr =
       "您将要赠送"
           + checkedPersons.size()
           + "位朋友,赠送金额为"
           + allAtm * checkedPersons.size()
           + "元,"
           + "是否赠送?";
   String phone = editPhone.getText().toString();
   if (isNum(phone)) {
     touDialog("确认要赠送吗?", alertStr);
   }
 }
예제 #17
0
 /** 读取本地渠道号 */
 public void getChannel() {
   String channel = shellRW.getStringValue("channel");
   if (channel.equals("") || channel == null) {
     shellRW.putStringValue("channel", Constants.COOP_ID);
   } else {
     Constants.COOP_ID = channel;
   }
 }
예제 #18
0
 private void initBetPojo() {
   RWSharedPreferences pre = new RWSharedPreferences(FootballSixSemiFinal.this, "addInfo");
   sessionid = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   betPojo.setPhonenum(phonenum);
   betPojo.setSessionid(sessionid);
   betPojo.setUserno(userno);
   betPojo.setBet_code(getZhuMa());
   betPojo.setLotno(lotno);
   betPojo.setBatchnum("1");
   betPojo.setBatchcode(batchCode);
   betPojo.setLotmulti(String.valueOf(iProgressBeishu));
   betPojo.setBettype("bet");
   betPojo.setAmount(getZhuShu() * 200 + "");
   betPojo.setZhushu(getZhuShu() + "");
 }
  private void addViewAndTouZhu(int redSize, int blueSize) {
    long betNums = caculateBetNums(redSize, blueSize);

    if (betNums > 10000) {
      dialogExcessive(10000);
    } else {
      BetAndGiftPojo betAndGiftPojo = new BetAndGiftPojo();

      String sessionid = shellRW.getStringValue("sessionid");
      String phonenum = shellRW.getStringValue("phonenum");
      String userno = shellRW.getStringValue("userno");
      String lotno = Constants.LOTNO_SSQ;

      betAndGiftPojo.setSessionid(sessionid);
      betAndGiftPojo.setPhonenum(phonenum);
      betAndGiftPojo.setUserno(userno);
      betAndGiftPojo.setBettype("bet");
      betAndGiftPojo.setBet_code("");
      betAndGiftPojo.setLotmulti("1");
      betAndGiftPojo.setBatchnum("1");
      betAndGiftPojo.setSellway("0");
      betAndGiftPojo.setLotno(lotno);
      betAndGiftPojo.setZhushu(String.valueOf(betNums));
      betAndGiftPojo.setAmount("" + betNums * 200);
      betAndGiftPojo.setIsSellWays("1");

      AddViewMiss addViewMiss = new AddViewMiss(this);
      CodeInfoMiss codeInfo = addViewMiss.initCodeInfo(2, 1);
      codeInfo.setTouZhuCode(
          SsqZiZhiXuanCode.simulateZhuma(selectedRedBallList, selectedBlueBallList));
      codeInfo.setZhuShu(Integer.valueOf(String.valueOf(betNums)));
      codeInfo.setAmt(Integer.valueOf(String.valueOf(betNums * 2)));
      codeInfo = setCodeInfoColor(codeInfo, selectedRedBallList, selectedBlueBallList);
      addViewMiss.addCodeInfo(codeInfo);

      ApplicationAddview app = (ApplicationAddview) getApplicationContext();
      app.setPojo(betAndGiftPojo);
      app.setAddviewmiss(addViewMiss);
      Intent intent = new Intent(SimulateSelectNumberActivity.this, OrderDetails.class);
      startActivity(intent);
    }
  }
  // 是否綁定绑定邮箱
  private boolean isBindedEmail() {
    // 初始化全局共享参数
    shellRW = new RWSharedPreferences(this, "addInfo");
    String email = shellRW.getStringValue("email");

    if (email == null || email.equals("") || email.equals("null")) {
      return false;
    } else {
      return true;
    }
  }
  private boolean isLogin() {
    boolean isLogin = true;

    shellRW = new RWSharedPreferences(this, "addInfo");
    String sessionidStr = shellRW.getStringValue("sessionid");
    if (sessionidStr == null || sessionidStr.equals("")) {
      isLogin = false;
    }

    return isLogin;
  }
예제 #22
0
  // 充值
  private void recharge(final RechargePojo rechargepojo) {
    RWSharedPreferences pre = new RWSharedPreferences(AlipaySecureActivity.this, "addInfo");
    sessionId = pre.getStringValue(ShellRWConstants.SESSIONID);
    phonenum = pre.getStringValue(ShellRWConstants.MOBILEID);
    userno = pre.getStringValue(ShellRWConstants.USERNO);
    ConnectivityManager ConnMgr =
        (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo info = ConnMgr.getActiveNetworkInfo();
    if (info.getExtraInfo() != null && info.getExtraInfo().equalsIgnoreCase("3gwap")) {
      Toast.makeText(this, "提醒:检测到您的接入点为3gwap,可能无法正确充值,请切换到3gnet!", Toast.LENGTH_LONG).show();
    }
    showDialog(0);
    new Thread(
            new Runnable() {

              @Override
              public void run() {
                String error_code = "00";
                message = "";
                // TODO Auto-generated method stub
                try {
                  rechargepojo.setSessionid(sessionId);
                  rechargepojo.setUserno(userno);
                  String re = RechargeInterface.getInstance().recharge(rechargepojo);

                  JSONObject obj = new JSONObject(re);
                  error_code = obj.getString("error_code");
                  message = obj.getString("message");
                  if (error_code.equals("0000")) {
                    url = obj.getString("return_url");
                  }
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                handler.handleMsg(error_code, message);
                progressdialog.dismiss();
              }
            })
        .start();
  }
예제 #23
0
 /** *分享绑定设置 */
 private void showsharesettingView() {
   returnType = 3;
   setContentView(R.layout.weibo_bind);
   is_sharetorenren = (Button) findViewById(R.id.isSharetoRenren);
   is_sharetosinaweibo = (Button) findViewById(R.id.isSharetoSina);
   is_sharetorenren.setBackgroundResource(R.drawable.off);
   token = shellRW.getStringValue("token");
   expires_in = shellRW.getStringValue("expires_in");
   if (token.equals("")) {
     is_sharetosinaweibo.setBackgroundResource(R.drawable.off);
   } else {
     is_sharetosinaweibo.setBackgroundResource(R.drawable.on);
   }
   is_sharetosinaweibo.setOnClickListener(moreActivityListener);
   is_sharetorenren.setOnClickListener(moreActivityListener);
   AccessTokenManager manager = new AccessTokenManager(this);
   if (manager.getAccessToken() == null || manager.getAccessToken().equals("")) {
     is_sharetorenren.setBackgroundResource(R.drawable.off);
   } else {
     is_sharetorenren.setBackgroundResource(R.drawable.on);
   }
 }
예제 #24
0
 /** 初始化 自动登录控件设置 */
 private void initAutoLoginSet() {
   isLogined = shellRW.getStringValue("sessionid");
   boolean is_auto_login = shellRW.getBooleanValue(ShellRWConstants.AUTO_LOGIN);
   if (isLogined.equals("") || isLogined.equals("null")) {
     auto_login_set.setBackgroundResource(R.drawable.off);
   } else {
     if (is_auto_login) {
       auto_login_set.setBackgroundResource(R.drawable.on);
     } else {
       auto_login_set.setBackgroundResource(R.drawable.off);
     }
   }
   auto_login_set.setOnClickListener(moreActivityListener);
 }
예제 #25
0
  /** 投注方法 */
  private void beginTouZhu() {
    RWSharedPreferences pre = new RWSharedPreferences(DanshiJiXuan.this, "addInfo");
    sessionId = pre.getStringValue("sessionid");
    phonenum = pre.getStringValue("phonenum");
    userno = pre.getStringValue("userno");
    if (sessionId.equals("")) {
      toLogin = true;
      Intent intentSession = new Intent(DanshiJiXuan.this, UserLogin.class);
      startActivityForResult(intentSession, 0);
    } else {

      if (balls.size() == 0) {
        alertInfo("请至少选择1注彩票");
      } else {
        if (addView.getSize() == 0) {
          addToCodes();
          alert_jixuan();
        } else {
          showAddViewDialog();
        }
      }
    }
  }
예제 #26
0
 /**
  * 是否下载开奖图片
  *
  * @param image
  * @throws JSONException
  */
 public void imageJson(JSONObject image) throws JSONException {
   String errorCode = image.getString("errorCode");
   shellRW.putStringValue("errorCode", errorCode);
   if (errorCode.equals("true")) {
     String jsonId = image.getString("id");
     String imageId = shellRW.getStringValue("imageId");
     if (imageId.equals("") || imageId == null || !imageId.equals(jsonId)) {
       if (isWifi == true) {
         shellRW.putStringValue("imageId", jsonId);
         DownLoadImg down = new DownLoadImg();
         down.downThread(image.getString("imageUrl"));
       }
     }
   }
 }
예제 #27
0
 public void beginTouZhu() {
   int iZhuShu = getZhuShu(); // 注数是注数*倍数的结果
   RWSharedPreferences pre = new RWSharedPreferences(FootballSFLottery.this, "addInfo");
   sessionid = pre.getStringValue("sessionid");
   if (sessionid == null || sessionid.equals("")) {
     Intent intentSession = new Intent(FootballSFLottery.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
     sfc_btn_touzhu.setClickable(true);
   } else {
     if (isTouZhu()) {
       Toast.makeText(FootballSFLottery.this, "请至少选择一注!", Toast.LENGTH_SHORT).show();
     } else if (iZhuShu * 2 > 20000) {
       DialogExcessive();
     } else {
       String sTouzhuAlert = "";
       //				sTouzhuAlert = getTouzhuAlertText();
       //				alert(sTouzhuAlert, getFormatZhuma());
       initBetPojo();
       toorderdetail();
     }
   }
 }
예제 #28
0
 public void beginTouZhu() {
   int iZhuShu = getZhuShu();
   RWSharedPreferences pre = new RWSharedPreferences(FootballSixSemiFinal.this, "addInfo");
   String sessionIdStr = pre.getStringValue("sessionid");
   if (sessionIdStr == null || sessionIdStr.equals("")) {
     Intent intentSession = new Intent(FootballSixSemiFinal.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
     liucb_btn_touzhu.setClickable(true);
   } else {
     if (isTouZhu()) {
       alert1("请至少选择一注!");
     } else if (iZhuShu * 2 > 20000) {
       DialogExcessive();
     } else {
       //				String sTouzhuAlert = "";
       //				sTouzhuAlert = getTouzhuAlert();
       //				alert(sTouzhuAlert,getFormatZhuma());
       initBetPojo();
       toorderdetail();
     }
   }
 }
        @Override
        public void onClick(View v) {
          String lotnoString = v.getTag(R.id.caizhong_set_checkbox).toString();

          if (CheckUtil.isWillSale(lotnoString, shellRW)) {
            PublicMethod.showMessage(
                mContext, PublicMethod.getMessageByLoto(mContext, shellRW, lotnoString));
          } else if (CheckUtil.isTickedClosed(lotnoString, shellRW)) {
            PublicMethod.showMessage(
                mContext, PublicMethod.getMessageByLoto(mContext, shellRW, lotnoString));
          } else {
            String checkOpenOrClosed = shellRW.getStringValue(lotnoString);
            if (checkOpenOrClosed.equals(Constants.CAIZHONG_OPEN)) {
              shellRW.putStringValue(
                  v.getTag(R.id.caizhong_set_checkbox).toString(), Constants.CAIZHONG_CLOSE);
              v.setBackgroundResource(R.drawable.off);
            } else {
              shellRW.putStringValue(
                  v.getTag(R.id.caizhong_set_checkbox).toString(), Constants.CAIZHONG_OPEN);
              v.setBackgroundResource(R.drawable.on);
            }
          }
        }
예제 #30
0
 /**
  * 获得当前期数
  *
  * @param string
  */
 public String[] getLotno(String string) {
   String error_code;
   String str[] = new String[4];
   // ShellRWSharesPreferences
   RWSharedPreferences shellRW = new RWSharedPreferences(this, "addInfo");
   String notice = shellRW.getStringValue(string);
   // 判断取值是否为空 cc 2010/7/9
   if (!notice.equals("") || notice != null) {
     try {
       JSONObject obj = new JSONObject(notice);
       error_code = obj.getString("error_code");
       if (error_code.equals("000000")) {
         JSONArray value = obj.getJSONArray("value");
         JSONObject re = value.getJSONObject(0);
         str[0] = re.getString("BATCHCODE");
         str[1] = re.getString("ENDTIME");
         str[2] = re.getString("LOTNO");
       }
     } catch (JSONException e) {
       e.printStackTrace();
     }
   }
   return str;
 }