public void initData() {
    //		for (int i = 0; i < orders.size(); i++) {
    //			sumtiaoshu = sumtiaoshu + orders.get(i).getOrderLists().size();//商品总条数
    //		}
    //		Tools.toast(getActivity(), "" + sumtiaoshu);
    //
    //		orderCenterAdapter = new OrderCenterAdapter(getActivity(), orders, mType, sumtiaoshu);
    //		mListView.setAdapter(orderCenterAdapter);
    //
    //		groupCount = mListView.getCount();
    //		for (int i = 0; i < groupCount; i++) {
    //			mListView.expandGroup(i);
    //		}
    ///////////////////////////////////////////////////////////////////////////////////////////
    List<OrderChild> list1 = new ArrayList<OrderChild>();
    list1.add(new OrderChild("1子id", "1子name", "规格:S/白色", "100", "100"));
    list1.add(new OrderChild("2子id", "2子name", "规格:S/白色", "100", "100"));
    list1.add(new OrderChild("3子id", "3子name", "规格:S/白色", "100", "100"));

    OrderGroup orderGroup1 = new OrderGroup("1组id", "1组name", list1);
    orders.add(orderGroup1);

    List<OrderChild> list2 = new ArrayList<OrderChild>();
    list2.add(new OrderChild("4子id", "4子name", "规格:S/黑色", "100", "100"));
    list2.add(new OrderChild("5子id", "5子name", "规格:S/黑色", "100", "100"));

    OrderGroup groupItem2 = new OrderGroup("2组id", "2组name", list2);
    orders.add(groupItem2);

    List<OrderChild> list3 = new ArrayList<OrderChild>();
    list3.add(new OrderChild("6子id", "6子name", "规格:S/红色", "100", "100"));
    list3.add(new OrderChild("7子id", "7子name", "规格:S/红色", "100", "100"));
    list3.add(new OrderChild("8子id", "8子name", "规格:S/红色", "100", "100"));

    OrderGroup groupItem3 = new OrderGroup("3组id", "3组name", list3);
    orders.add(groupItem3);

    for (int i = 0; i < orders.size(); i++) {
      sumtiaoshu = sumtiaoshu + orders.get(i).getOrderLists().size(); // 商品总条数
    }
    Tools.toast(getActivity(), "" + sumtiaoshu);
    orderCenterAdapter = new OrderCenterAdapter(getActivity(), orders, mType, sumtiaoshu);
    mListView.setAdapter(orderCenterAdapter);
    orderCenterAdapter.notifyDataSetChanged();

    groupCount = mListView.getCount();
    for (int i = 0; i < groupCount; i++) {
      mListView.expandGroup(i);
    }
  }
Esempio n. 2
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   Tools.Log("BaseActivity�ر�");
   BaseApp.getInstance().finishActivity(this);
 }