Esempio n. 1
0
  /** 查询提现记录详情 */
  public void queryCashDetail(final MyHandler handler, final String cashdetailId) {
    if (dialog != null && dialog.isShowing()) return;
    dialog =
        UserCenterDialog.onCreateDialog(
            mContext, mContext.getResources().getString(R.string.recommend_network_connection));
    dialog.show();
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = queryCashNet(cashdetailId);
                try {
                  JSONObject obj = new JSONObject(str);
                  final String msg = obj.getString("message");
                  final String error = obj.getString("error_code");
                  setRtnJSONObject(obj);
                  handler.handleMsg(error, msg);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                dialog.dismiss();
              }
            });
    t.start();
  }
  public void Betting() {
    final ProgressDialog progressDialog = UserCenterDialog.onCreateDialog(this);
    progressDialog.show();

    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = BetAndGiftInterface.getInstance().betOrGift(betAndGift);
                progressDialog.dismiss();
                try {
                  JSONObject obj = new JSONObject(str);
                  String msg = obj.getString("message");
                  String error = obj.getString("error_code");
                  handler.handleMsg(error, msg);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
              }
            });
    t.start();
  }
Esempio n. 3
0
  @Override
  public void touzhuIssue(String issue) {
    // TODO Auto-generated method stub
    betAndGift.setBatchcode(issue);
    progressdialog = UserCenterDialog.onCreateDialog(this);
    progressdialog.show();
    // 加入是否改变切入点判断 陈晨 8.11
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = BetAndGiftInterface.getInstance().betOrGift(betAndGift);
                try {
                  JSONObject obj = new JSONObject(str);
                  String msg = obj.getString("message");
                  String error = obj.getString("error_code");
                  handler.handleMsg(error, msg);
                  isNoIssue(handler, obj);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                progressdialog.dismiss();
              }
            });
    t.start();
  }
Esempio n. 4
0
  /** 投注action */
  public void doBettingAction(final MyHandler handler, final BetAndGiftPojo betAndGift) {
    if (dialog != null && dialog.isShowing()) return;
    dialog =
        UserCenterDialog.onCreateDialog(
            mContext, mContext.getResources().getString(R.string.recommend_network_connection));
    dialog.show();

    // 加入是否改变切入点判断 陈晨 8.11
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = BetAndGiftInterface.getInstance().betOrGift(betAndGift);
                try {
                  JSONObject obj = new JSONObject(str);
                  final String msg = obj.getString("message");
                  final String error = obj.getString("error_code");
                  setRtnJSONObject(obj);
                  handler.handleMsg(error, msg);
                } catch (JSONException e) {
                  e.printStackTrace();
                  // TODO Auto-generated method stub
                }
                dialog.dismiss();
                // dialog = null;
              }
            });
    t.start();
  }
Esempio n. 5
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();
            }
          }
        });
  }
 /** 联网获取所有彩种开奖信息 */
 public void noticeAllNet() {
   if (NoticeMainActivity.isFirstNotice) {
     final ProgressDialog dialog = UserCenterDialog.onCreateDialog(this);
     dialog.show();
     final Handler handler = new Handler();
     new Thread(
             new Runnable() {
               @Override
               public void run() {
                 JSONObject lotteryInfos =
                     NoticeInterface.getInstance().getLotteryAllNotice(); // 开奖信息json对象
                 // 将获取到的开奖信息放到常量类中
                 NoticeActivityGroup.analysisLotteryNoticeJsonObject(lotteryInfos);
                 dialog.cancel();
                 handler.post(
                     new Runnable() {
                       @Override
                       public void run() {
                         // TODO Auto-generated method stub
                         initList();
                       }
                     });
               }
             })
         .start();
   } else {
     initList();
   }
 }
 /** 联网获取所有彩种开奖信息 */
 public void noticeAllNet(final boolean isRed) {
   if (NoticeMainActivity.isFirstNotice) {
     final ProgressDialog dialog = UserCenterDialog.onCreateDialog(this);
     dialog.show();
     final Handler handler = new Handler();
     new Thread(
             new Runnable() {
               @Override
               public void run() {
                 dialog.cancel();
                 handler.post(
                     new Runnable() {
                       @Override
                       public void run() {
                         // TODO Auto-generated method stub
                         addBallView(isRed);
                       }
                     });
               }
             })
         .start();
   } else {
     addBallView(isRed);
   }
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   // TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   progress = UserCenterDialog.onCreateDialog(this);
   context = this;
   initDialog(NoticeActivityGroup.LOTNO);
 }
  private void netting() {
    final Handler tHandler = new Handler();
    final ProgressDialog dialog = UserCenterDialog.onCreateDialog(this);
    dialog.show();
    new Thread(
            new Runnable() {
              @Override
              public void run() {
                final JSONObject prizemore =
                    PrizeInfoInterface.getInstance().getNoticePrizeInfo(lotno, "1", "100");
                try {
                  final String msg = prizemore.getString("message");
                  final String code = prizemore.getString("error_code");
                  if (code.equals("0000")) {
                    final List<Map<String, Object>> list = JsonToString(prizemore);
                    tHandler.post(
                        new Runnable() {
                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            dialog.dismiss();
                            SubEfficientAdapter adapter =
                                new SubEfficientAdapter(
                                    HighFrequencyNoticeHistroyActivity.this, str, list);
                            listview.setAdapter(adapter);
                          }
                        });

                  } else {
                    tHandler.post(
                        new Runnable() {
                          @Override
                          public void run() {
                            dialog.dismiss();
                            Toast.makeText(
                                    HighFrequencyNoticeHistroyActivity.this,
                                    msg,
                                    Toast.LENGTH_SHORT)
                                .show();
                          }
                        });
                  }
                } catch (JSONException e) {
                  // TODO: handle exception
                }
              }
            })
        .start();
  }
  // 充值
  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();
  }
Esempio n. 11
0
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   getWindow()
       .setFlags(
           WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
   setContentView(R.layout.buy_activity);
   progressdialog = UserCenterDialog.onCreateDialog(this);
   HEIGHT = getWindowManager().getDefaultDisplay().getHeight(); // 屏幕的高度
   mGallery = (FlingGallery) findViewById(R.id.buy_activity_fling_gallery);
   initNumber();
   initLights();
   initGallery();
   initImgView();
   initRollingText();
   isShortcut();
 }
 private void initTextViewContent() {
   progressdialog = UserCenterDialog.onCreateDialog(this);
   progressdialog.show();
   alipay_content = (TextView) findViewById(R.id.alipay_content);
   JSONObject jsonObject = getJSONByLotno();
   try {
     String conten = jsonObject.get("content").toString();
     alipay_content.setText(conten);
     if (progressdialog != null) {
       progressdialog.dismiss();
     }
   } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
 /** @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();
 }
Esempio n. 14
0
 private void getJSONByLotno() {
   progressdialog = UserCenterDialog.onCreateDialog(this);
   progressdialog.show();
   final Handler handler = new Handler();
   new Thread(
           new Runnable() {
             @Override
             public void run() {
               // TODO Auto-generated method stub
               JSONObject jsonObjectByLotno =
                   HelpCenterInterface.getInstance().accountDetailQuery(type, pageIndex);
               try {
                 String error_code = jsonObjectByLotno.getString("error_code");
                 final String message = jsonObjectByLotno.getString("message");
                 if (error_code.equals("0000")) {
                   getList(jsonObjectByLotno);
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           showView(titleList);
                         }
                       });
                 } else {
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
                         }
                       });
                 }
               } catch (Exception e) {
                 e.printStackTrace();
               }
               if (progressdialog != null) {
                 progressdialog.dismiss();
               }
             }
           })
       .start();
 }
Esempio n. 15
0
 /** 联网检测新版本 */
 public void isUpdateNet() {
   pBar = UserCenterDialog.onCreateDialog(this);
   pBar.show();
   final Handler handler = new Handler();
   new Thread(
           new Runnable() {
             @Override
             public void run() {
               // TODO Auto-generated method stub
               JSONObject obj;
               try {
                 obj = new JSONObject(SoftwareUpdateInterface.getInstance().softwareupdate(null));
                 pBar.dismiss();
                 String softwareErrorCode = obj.getString("errorCode");
                 if (softwareErrorCode.equals("true")) {
                   // 需要升级,设置升级相关字段
                   final String softwareurl = obj.getString("updateurl");
                   final String softwaretitle = obj.getString("title");
                   final String softwaremessageStr = obj.getString("message");
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           MainUpdate update =
                               new MainUpdate(
                                   MoreActivity.this,
                                   new Handler(),
                                   softwareurl,
                                   softwaremessageStr,
                                   softwaretitle);
                           update.showDialog();
                           update.createMyDialog();
                         }
                       });
                 }
               } catch (JSONException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
               }
             }
           })
       .start();
 }
Esempio n. 16
0
  public void getbatchcodes() {
    final Handler hand = new Handler();
    final ProgressDialog dialog = UserCenterDialog.onCreateDialog(this);
    dialog.show();
    batchcodes.clear();
    new Thread(
            new Runnable() {

              @Override
              public void run() {
                // TODO Auto-generated method stub
                String bathcode =
                    getRecoveryBatchCode
                        .getInstance()
                        .getCode(betAndGift.getLotno(), String.valueOf(iProgressQishu));

                try {
                  JSONObject json = new JSONObject(bathcode);
                  JSONArray array = json.getJSONArray("result");
                  String errorcode = json.getString("error_code");
                  final String message = json.getString("message");
                  dialog.dismiss();
                  if (errorcode.equals("0000")) {
                    for (int i = 0; i < array.length(); i++) {
                      JSONObject obj = array.getJSONObject(i);
                      String betcode = obj.getString("batchCode");
                      batchcodes.add(betcode);
                    }
                    hand.post(
                        new Runnable() {

                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            getviewofzhuiqi();
                          }
                        });
                  } else {
                    hand.post(
                        new Runnable() {

                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            dialog.dismiss();
                            Toast.makeText(ZixuanZhuihao.this, message, Toast.LENGTH_SHORT).show();
                          }
                        });
                    state = 0;
                  }

                } catch (JSONException e) {
                  // TODO: handle exception
                  hand.post(
                      new Runnable() {

                        @Override
                        public void run() {
                          // TODO Auto-generated method stub
                          dialog.dismiss();
                          Toast.makeText(ZixuanZhuihao.this, "期号获取失败", Toast.LENGTH_SHORT).show();
                        }
                      });
                  state = 0;
                }
              }
            })
        .start();
  }
Esempio n. 17
0
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   progress = UserCenterDialog.onCreateDialog(this);
   setContentView(R.layout.notice_prizes_single_specific_main);
   noticeAllNet();
 }