private void InitData() { readyToGetAllGoodsByTagID(tagRec.getId(), true); lvProduct.setonRefreshListener( new OnRefreshListener() { @Override public void onRefresh() { readyToGetAllGoodsByTagID(tagRec.getId(), true); } }); lvProduct.setAddMoreListener( new OnAddMoreListener() { @Override public void onAddMore() { readyToGetAllGoodsByTagID(tagRec.getId(), false); } }); productAdapter = new ProductAdapter(this, R.layout.category_product_listview_item, productList); lvProduct.setAdapter(productAdapter); productAdapter.setOnItemClickListener( new ProductAdapter.OnItemClickListener() { @Override public void onItemClick(ProductRec rec, int pos) { Intent mIntent = new Intent(TagReviewListActivity.this, ProductDetailActivity.class); mIntent.putExtra(ProductDetailActivity.KEY_PRODUCT_REC, rec); mIntent.putExtra(ProductDetailActivity.KET_REC_NUMBER, pos); startActivityForResult(mIntent, REQUEST_CODE_SHOW_PRODUCT); } }); productAdapter.setAddFavClickListener( new ProductAdapter.OnItemClickListener() { @Override public void onItemClick(ProductRec rec, int pos) { readyToAddFav(rec.getId(), pos); } }); productAdapter.setSubFavClickListener( new ProductAdapter.OnItemClickListener() { @Override public void onItemClick(ProductRec rec, int pos) { chanceMyFvaDialog(rec, pos); } }); }
private void refreshList() { productAdapter.notifyDataSetChanged(); lvProduct.onRefreshComplete(); }