@Override
 protected void onPause() {
   super.onPause();
   if (EcmobileManager.getUmengKey(this) != null) {
     MobclickAgent.onPageEnd("CategoryList");
     MobclickAgent.onPause(this);
   }
 }
 @Override
 protected void onResume() {
   super.onResume();
   if (EcmobileManager.getUmengKey(this) != null) {
     MobclickAgent.onPageStart("CategoryList");
     MobclickAgent.onResume(this, EcmobileManager.getUmengKey(this), "");
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.d1_category);

    backButton = (ImageView) findViewById(R.id.top_view_back);
    title = (TextView) findViewById(R.id.top_view_text);
    backButton.setVisibility(View.VISIBLE);
    backButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            finish();
          }
        });

    childListView = (XListView) findViewById(R.id.child_list);
    childListView.setPullLoadEnable(false);
    childListView.setPullRefreshEnable(false);
    String categoryStr = getIntent().getStringExtra("category");
    title.setText(getIntent().getStringExtra("category_name"));

    try {
      JSONObject jsonObject = new JSONObject(categoryStr);
      CATEGORY category1 = CATEGORY.fromJson(jsonObject);
      this.category = category1;
      childListAdapter = new D0_CategoryAdapter(this, this.category.children);
      childListView.setAdapter(childListAdapter);
      childListView.setOnItemClickListener(
          new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
              if (position - 1 < category.children.size()) {
                CATEGORY item = category.children.get(position - 1);

                try {
                  Intent intent =
                      new Intent(D1_CategoryActivity.this, B1_ProductListActivity.class);
                  FILTER filter = new FILTER();
                  filter.category_id = String.valueOf(item.id);
                  intent.putExtra(B1_ProductListActivity.FILTER, filter.toJson().toString());
                  startActivity(intent);
                  overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
                } catch (JSONException e) {

                }
              }
            }
          });
    } catch (JSONException e) {

    }
  }