每次请求都重置一次fragment

    List<Res_BoothCount> boothCounts = t.getList(Res_BoothCount.class);
                mRgNavi.removeAllViews();
                for (BaseFragment fragment : mAllFrags) {
                    removeFragment(fragment);
                }
                mAllFrags.clear();
                for (Res_BoothCount boothCount : boothCounts) {
                    MLogUtil.e("boothCount " + boothCount.getBoothId());
                    TanweiFragment1 fragment1 = new TanweiFragment1();
                    mAllFrags.add(fragment1);
                    tanweiOrder = boothCount.getOrderCount();
                    tanweiName = boothCount.getBoothName();
                    showFrag(fragment1);
                    tempButton = new RadioButton(mBaseActivity);
                    tempButton.setBackgroundResource(R.drawable.tanwei1_selector); // 设置RadioButton的背景图片
                    tempButton.setButtonDrawable(null); // 设置按钮的样式
                    // tempButton.setPadding(80, 0, 0, 0); // 设置文字距离按钮四周的距离

                    tempButton.setText("    " + tanweiName + " (" + tanweiOrder + "单" + ")");

                    mRgNavi.addView(tempButton, LinearLayout.LayoutParams.WRAP_CONTENT,
                            LinearLayout.LayoutParams.WRAP_CONTENT);
                    Log.e("1", "run:--------->tanweiOrder: " + tanweiOrder);
                    // // mTvTanwei1Num.setText(boothCount.getOrderCount()+"");
                    if (boothCount.getBoothId().equals("370203010001")) {
                        // radioGroup.check(radioButton.getId());
                        tempButton.setChecked(true);
                        // new TanweiFragment1();
                        Log.e("1", "run:--------->66tanweiOrder: " + tanweiOrder);
                        Log.e("1", "run:--------->3333333 ");
                        // showFrag(mTanweiFragment1);
                    }
                }
private void orderPageInit1(String regCode, String startTime, String endTime) {
        // TODO Auto-generated method stub
        ApiService.orderPageInit(regCode, startTime, endTime, new BaseCallBack() {
            @Override
            public void onSuccess(Res_BaseBean t) {
                // TODO Auto-generated method stub
                List<Res_BoothCount> boothCounts = t.getList(Res_BoothCount.class);
                mRgNavi.removeAllViews();
                for (BaseFragment fragment : mAllFrags) {
                    removeFragment(fragment);
                }
                mAllFrags.clear();
                for (Res_BoothCount boothCount : boothCounts) {
                    MLogUtil.e("boothCount " + boothCount.getBoothId());
                    TanweiFragment1 fragment1 = new TanweiFragment1();
                    mAllFrags.add(fragment1);
                    tanweiOrder = boothCount.getOrderCount();
                    tanweiName = boothCount.getBoothName();
                    showFrag(fragment1);
                    tempButton = new RadioButton(mBaseActivity);
                    tempButton.setBackgroundResource(R.drawable.tanwei1_selector); // 设置RadioButton的背景图片
                    tempButton.setButtonDrawable(null); // 设置按钮的样式
                    // tempButton.setPadding(80, 0, 0, 0); // 设置文字距离按钮四周的距离

                    tempButton.setText("    " + tanweiName + " (" + tanweiOrder + "单" + ")");

                    mRgNavi.addView(tempButton, LinearLayout.LayoutParams.WRAP_CONTENT,
                            LinearLayout.LayoutParams.WRAP_CONTENT);
                    Log.e("1", "run:--------->tanweiOrder: " + tanweiOrder);
                    // // mTvTanwei1Num.setText(boothCount.getOrderCount()+"");
                    if (boothCount.getBoothId().equals("370203010001")) {
                        // radioGroup.check(radioButton.getId());
                        tempButton.setChecked(true);
                        // new TanweiFragment1();
                        Log.e("1", "run:--------->66tanweiOrder: " + tanweiOrder);
                        Log.e("1", "run:--------->3333333 ");
                        // showFrag(mTanweiFragment1);
                    }
                }
                // int tanweiNum = boothCounts.size();
                // Log.e("1", "run:--------->tanweiNum: " + tanweiNum);
                // for (int i = 1; i <= tanweiNum + 1; i++) {
                // tempButton = new RadioButton(mBaseActivity);
                // tempButton.setBackgroundResource(R.drawable.tanwei1_selector);
                // // 设置RadioButton的背景图片
                // tempButton.setButtonDrawable(null); // 设置按钮的样式
                // // tempButton.setPadding(80, 0, 0, 0); // 设置文字距离按钮四周的距离
                //
                // tempButton.setText("摊位 " + i + " (" + tanweiOrder + "单" +
                // ")");
                // mRgNavi.addView(tempButton,
                // LinearLayout.LayoutParams.WRAP_CONTENT,
                // LinearLayout.LayoutParams.WRAP_CONTENT);
                //
                // if (i == 1) {
                // // radioGroup.check(radioButton.getId());
                // tempButton.setChecked(true);
                // showFrag(mTanweiFragment1);
                // }
                //
                // }

                // Log.e("1", "run:--------->666666 ");
                // mTvTanwei1Num.setText(boothCounts.get(0).getOrderCount() +
                // "");
                // mTvTanwei2Num.setText(boothCounts.get(1).getOrderCount() +
                // "");
                // mTvTanwei3Num.setText(boothCounts.get(2).getOrderCount() +
                // "");

            }

            @Override
            public void onFailure(int code, String message) {
                // TODO Auto-generated method stub

                Toast.makeText(getApplication(), message, Toast.LENGTH_SHORT).show();

            }

        });
    }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值