Runnable如何传参

private class TimerUpdateTask implements Runnable{
        private boolean isUnion = false;

        public TimerUpdateTask(boolean isUnion){
            this.isUnion = isUnion ;
        }

        @Override
        public void run() {
            String printMsg = "";
            String mSerialNumber = out_trade_no;
            final String guideInfo = guideinfo;
            if (this.isUnion) {
                UnionPayDialog.dismissUnionDialog();
                PayResultDialog.showPayResultDialog(getContext(), true, mUnionPayResult.getOrderNum(), mUnionPayResult.getConfirmNum(), ALLPrize + "", "", "003136");
                printMsg = PrintMsgAndDialogUtils.setPrintMsg(myApplication, 3, mCardNo, mPatientName, "门诊缴费",
                        "", patientInfo, ALLPrize + "",
                        mSerialNumber,choosedBean.get(0).getOrderID(),invoiceNo);
                LogSaverUtils.saveTradePrintLog(mUnionPayResult.getConfirmNum(), printMsg + "\n" + guideInfo + "\n\n\n\n\n");
                LogSaverUtils.sendAndSaveUnionTradeLog(myApplication, getContext(), "1", mUnionPayResult, "门诊缴费", secondTrackData, field55, cardSN, patientInfo, mPatientID, mPatientName, TransMoneyUtils.transMoney(ALLPrize+""));
            } else {
                QRCodePayDialog.dismissQRCodeDialog();
//            PayResultDialog.showPayResultDialog(getContext(), true, transaction_id, out_trade_no, ALLPrize + "", "", "003136");
                PayResultDialog.showPayResultDialog(getContext(), true, out_trade_no, out_trade_no, ALLPrize + "", "", "003136");
                LogSaverUtils.saveQRTradeLog(out_trade_no, "支付成功,确认缴费成功" + LogSaverUtils.getQRSaveLog(out_trade_no, mPatientName, ALLPrize + ""));
                printMsg = PrintMsgAndDialogUtils.setPrintMsg(myApplication, isWeixinPay ? 2 : 1, mCardNo,
                        mPatientName, "门诊缴费", "", patientInfo, ALLPrize + "",
                        mSerialNumber,choosedBean.get(0).getOrderID(),invoiceNo);
                LogSaverUtils.saveTradePrintLog(out_trade_no, printMsg + "\n" + guideInfo + "\n\n\n\n\n"); QRCodePayDialog.dismissQRCodeDialog();
//            PayResultDialog.showPayResultDialog(getContext(), true, transaction_id, out_trade_no, ALLPrize + "", "", "003136");
                PayResultDialog.showPayResultDialog(getContext(), true, out_trade_no, out_trade_no, ALLPrize + "", "", "003136");
                LogSaverUtils.saveQRTradeLog(out_trade_no, "支付成功,确认缴费成功" + LogSaverUtils.getQRSaveLog(out_trade_no, mPatientName, ALLPrize + ""));
                printMsg = PrintMsgAndDialogUtils.setPrintMsg(myApplication, isWeixinPay ? 2 : 1, mCardNo,
                        mPatientName, "门诊缴费", "", patientInfo, ALLPrize + "",
                        mSerialNumber,choosedBean.get(0).getOrderID(),invoiceNo);
                LogSaverUtils.saveTradePrintLog(out_trade_no, printMsg + "\n" + guideInfo + "\n\n\n\n\n");
            }
            if (prescription.getResultInfo().size() > 0) {
                mPrescriptionAdapter.removePosition(choosedBean.get(0));
                info_dptnam.setText("-");
                info_docname.setText("-");
                info_money.setText("-");
            }
            final String finalPrintMsg = printMsg;
            PayResultDialog.setPrintClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    PayResultDialog.dismissPayResultDialog();
                    PrintMsgAndDialogUtils.showPrintDialog(getContext());
                    if (UrlConf.shouji) {
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                PrintMsgAndDialogUtils.printChangeFinishView();
                            }
                        }, 3000);
                    } else {
                        Bitmap qrBitmap = null;
                        try {
                            qrBitmap = QRCodeUtil.CreateOneDCode(mPatientID, 400, 200);
                        } catch (WriterException e) {
                            e.printStackTrace();
                        }
                        PrinterUtils.getInstances(getContext()).startPrint(finalPrintMsg, guideinfo + "",qrBitmap);
                        PrinterUtils.getInstances(getContext()).setPrintFinishListener(new PrintFinishListener() {
                            @Override
                            public void onPrintSuccess() {
                                PrintMsgAndDialogUtils.printChangeFinishView();
                            }

                            @Override
                            public void onPrintFailed() {

                            }
                        });
                    }
                }
            });
        }
    }

 

timerUpdateHandler = new Handler();
TimerUpdateTask timerUpdateTask = new TimerUpdateTask(isUnion);
timerUpdateHandler.postDelayed(timerUpdateTask,5000);

 

转载于:https://www.cnblogs.com/Jackie-zhang/p/8876186.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值