自定义列表视图中的项目未使用新 json 数据 android 进行回收
items in custom listview not recycling with new json data android
我正在使用自定义 listview
,它有 2 种不同的单项布局。
我的 json 数据:
{
"status": "success",
"response": [
{
"store_id": "1",
"store_name": "Prashant Stores",
"items": [
{
"item_id": "1",
"item_name": "Kellogs Cornflakes",
"item_price": "75",
"item_size": "500 mg",
"item_quantity": "1",
"item_total": "75",
"delivery_boy_status_id": "3",
"delivery_boy_status": "Delivered",
"is_available": "1"
},
{
"item_id": "2",
"item_name": "Chocos",
"item_price": "75",
"item_size": "1 kg",
"item_quantity": "1",
"item_total": "75",
"delivery_boy_status_id": "3",
"delivery_boy_status": "Delivered",
"is_available": "1"
}
]
},
{
"store_id": "5",
"store_name": "Corner Stores",
"items": [
{
"item_id": "4",
"item_name": "Chocos",
"item_price": "400",
"item_size": "1 kg",
"item_quantity": "1",
"item_total": "400",
"delivery_boy_status_id": "1",
"delivery_boy_status": "To be Collected",
"is_available": "1"
}
]
}
],
"message": ""
}
所需输出:
我的 activity
hashMap = new HashMap<>();
jsonObj = userFunction.getCustomerWiseDetails(deliveryBoyID, token, orderID);
Log.e(TAG, jsonObj.toString());
status = jsonObj.getString("status");
message = jsonObj.getString("message");
if (status.equalsIgnoreCase("success")) {
jsonArray = jsonObj.getJSONArray("response");
for (int i = 0; i < jsonArray.length(); i++) {
customerwiseDetailsListData = new ArrayList<>();
// customerwiseDetailsModel1.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
// customerwiseDetailsModel1.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
JSONObject jsonObjResponse = jsonArray.getJSONObject(i);
JSONArray jsonArrayItem = jsonObjResponse.getJSONArray("items");
for (int j = 0; j < jsonArrayItem.length(); j++) {
customerwiseDetailsModel = new CustomerwiseDetailsModel();
customerwiseDetailsModel.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
customerwiseDetailsModel.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
customerwiseDetailsModel.setItem_id(jsonArrayItem.getJSONObject(j).getString("item_id"));
customerwiseDetailsModel.setItem_name(jsonArrayItem.getJSONObject(j).getString("item_name"));
customerwiseDetailsModel.setItem_price(jsonArrayItem.getJSONObject(j).getString("item_price"));
customerwiseDetailsModel.setItem_size(jsonArrayItem.getJSONObject(j).getString("item_size"));
customerwiseDetailsModel.setItem_quantity(jsonArrayItem.getJSONObject(j).getString("item_quantity"));
customerwiseDetailsModel.setItem_total(jsonArrayItem.getJSONObject(j).getString("item_total"));
customerwiseDetailsModel.setDelivery_boy_status_id(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status_id"));
customerwiseDetailsModel.setDelivery_boy_status(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status"));
customerwiseDetailsModel.setIs_available(jsonArrayItem.getJSONObject(j).getString("is_available"));
if (j == (jsonArrayItem.length() - 1))
customerwiseDetailsModel.visible = "0";
else
customerwiseDetailsModel.visible = "1";
customerwiseDetailsListData.add(customerwiseDetailsModel);
hashMap.put(i, customerwiseDetailsListData);
}
}
我的适配器
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
itemsData = hasMap.get(position);
Log.d(TAG," hasMap "+hasMap.toString());
ViewHolder viewHolder;
View view = null;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = inflater.inflate(R.layout.listview_row_neworders_customer_wise_details, null, false);
viewHolder.txt_store_name = (TextView) convertView.findViewById(R.id.storename);
viewHolder.container = (LinearLayout) convertView.findViewById(R.id.neworders_customer_wise_details_container);
for (int i=0;i<itemsData.size();i++){
CustomerwiseDetailsModel test = itemsData.get(i);
Log.d(TAG," test "+itemsData.get(i).getStore_name());
view = inflater.inflate(R.layout.neworders_customer_wise_details_linearlayout, null);
viewHolder.txt_item_name = (TextView) view.findViewById(R.id.txt_product_name);
viewHolder.txt_item_size = (TextView) view.findViewById(R.id.txt_product_weight);
viewHolder.txt_item_quantity = (TextView) view.findViewById(R.id.txt_recurring_total_price_qnty);
viewHolder.txt_item_total = (TextView) view.findViewById(R.id.txt_recurring_total_price);
viewHolder.divider = (TextView) view.findViewById(R.id.divider);
viewHolder.container.addView(view);
viewHolder.txt_store_name.setText(test.getStore_name());
viewHolder.txt_item_name.setText(test.getItem_name());
viewHolder.txt_item_size.setText(test.getItem_size());
viewHolder.txt_item_quantity.setText(test.getItem_price() + " x" + test.getItem_quantity());
viewHolder.txt_item_total.setText(test.getItem_total());
}
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
return convertView;
}
何时滚动我的 listview
列表中的最后一项没有给我数据的更新值。
我看到列表中的第 2 个项目值与最后一个重复。
我的异步任务
class GetCustomerWiseDetails extends AsyncTask<Void, Void, String> {
String status, message;
JSONArray jsonArray;
JSONObject jsonItems;
String deliveryBoyID, token;
@Override
protected void onPreExecute() {
super.onPreExecute();
error_flag = 0;
listviewCustomerWiseDetails.setVisibility(View.VISIBLE);
error_layout.setVisibility(View.INVISIBLE);
img_no_internet.setVisibility(View.INVISIBLE);
img_no_results.setVisibility(View.INVISIBLE);
img_server_error.setVisibility(View.INVISIBLE);
progressDialog.setMessage("Getting customers ...");
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(true);
progressDialog.show();
deliveryBoyID = utilClass.getSharePerefernce(CustomerwiseDetailsActivity.this, UtilClass.KEY_DELIVETY_BY_ID, "0");
token = utilClass.getSharePerefernce(CustomerwiseDetailsActivity.this, UtilClass.KEY_TOKEN, "0");
}
@Override
protected String doInBackground(Void... params) {
if (NetworkCheck.isNetworkAvailable(CustomerwiseDetailsActivity.this)) {
try {
hashMap = new HashMap<>();
jsonObj = userFunction.getCustomerWiseDetails(deliveryBoyID, token, orderID);
Log.e(TAG, jsonObj.toString());
status = jsonObj.getString("status");
message = jsonObj.getString("message");
if (status.equalsIgnoreCase("success")) {
jsonArray = jsonObj.getJSONArray("response");
for (int i = 0; i < jsonArray.length(); i++) {
customerwiseDetailsListData = new ArrayList<>();
// customerwiseDetailsModel1.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
// customerwiseDetailsModel1.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
JSONObject jsonObjResponse = jsonArray.getJSONObject(i);
JSONArray jsonArrayItem = jsonObjResponse.getJSONArray("items");
for (int j = 0; j < jsonArrayItem.length(); j++) {
customerwiseDetailsModel = new CustomerwiseDetailsModel();
customerwiseDetailsModel.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
customerwiseDetailsModel.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
customerwiseDetailsModel.setItem_id(jsonArrayItem.getJSONObject(j).getString("item_id"));
customerwiseDetailsModel.setItem_name(jsonArrayItem.getJSONObject(j).getString("item_name"));
customerwiseDetailsModel.setItem_price(jsonArrayItem.getJSONObject(j).getString("item_price"));
customerwiseDetailsModel.setItem_size(jsonArrayItem.getJSONObject(j).getString("item_size"));
customerwiseDetailsModel.setItem_quantity(jsonArrayItem.getJSONObject(j).getString("item_quantity"));
customerwiseDetailsModel.setItem_total(jsonArrayItem.getJSONObject(j).getString("item_total"));
customerwiseDetailsModel.setDelivery_boy_status_id(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status_id"));
customerwiseDetailsModel.setDelivery_boy_status(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status"));
customerwiseDetailsModel.setIs_available(jsonArrayItem.getJSONObject(j).getString("is_available"));
if (j == (jsonArrayItem.length() - 1))
customerwiseDetailsModel.visible = "0";
else
customerwiseDetailsModel.visible = "1";
customerwiseDetailsListData.add(customerwiseDetailsModel);
hashMap.put(i, customerwiseDetailsListData);
}
}
} else if (status.equalsIgnoreCase("invalid parameters")) {
error_flag = 2;
Log.e(TAG, "invalid parameters");
} else if (status.equalsIgnoreCase("invalid user")) {
error_flag = 3;
Log.e(TAG, "No Data");
} else if (status.equalsIgnoreCase("error")) {
error_flag = 3;
Log.e(TAG, "No Data");
}
Log.e(TAG, "****** status " + status);
return String.valueOf(jsonObj);
} catch (Exception e) {
status = "Error";
error_flag = 2;
Log.e(TAG, e.toString());
}
} else {
error_flag = 1;
Log.e(TAG, "Network Error");
}
return null;
}
@Override
protected void onPostExecute(String response) {
super.onPostExecute(response);
Log.e(TAG, " **** error **** " + error_flag);
if (error_flag == 1) {
listviewCustomerWiseDetails.setVisibility(View.GONE);
error_layout.setVisibility(View.VISIBLE);
img_no_internet.setVisibility(View.VISIBLE);
} else if (error_flag == 2) {
listviewCustomerWiseDetails.setVisibility(View.GONE);
error_layout.setVisibility(View.VISIBLE);
img_server_error.setVisibility(View.VISIBLE);
} else if (error_flag == 3) {
listviewCustomerWiseDetails.setVisibility(View.GONE);
error_layout.setVisibility(View.VISIBLE);
img_no_results.setVisibility(View.VISIBLE);
} else if (error_flag == 0) {
customerwiseDeatilsAdapter = new CustomerwiseDeatilsAdapter(CustomerwiseDetailsActivity.this, hashMap);
listviewCustomerWiseDetails.setAdapter(customerwiseDeatilsAdapter);
customerwiseDeatilsAdapter.notifyDataSetChanged();
}
if ((progressDialog != null) && progressDialog.isShowing()) {
progressDialog.dismiss();
}
progressDialog = null;
}
}
在你的 activity 循环之后,写下这行:
myAdapter.notifyDataSetChanged();
重写你的代码如下
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
itemsData = hasMap.get(position);
Log.d(TAG," hasMap "+hasMap.toString());
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = inflater.inflate(R.layout.listview_row_neworders_customer_wise_details, null, false);
viewHolder.txt_store_name = (TextView) convertView.findViewById(R.id.storename);
viewHolder.container = (LinearLayout) convertView.findViewById(R.id.neworders_customer_wise_details_container);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.container.removeAllViews();
for (int i=0;i<itemsData.size();i++){
CustomerwiseDetailsModel test = itemsData.get(i);
viewHolder.txt_store_name.setText(test.getStore_name());
Log.d(TAG," test "+itemsData.get(i).getStore_name());
View view = inflater.inflate(R.layout.neworders_customer_wise_details_linearlayout, null);
((TextView) view.findViewById(R.id.txt_product_name)).setText(test.getItem_name());
((TextView) view.findViewById(R.id.txt_product_weight)).setText(test.getItem_size());
((TextView) view.findViewById(R.id.txt_recurring_total_price_qnty)).setText(test.getItem_price() + " x" + test.getItem_quantity());
((TextView) view.findViewById(R.id.txt_recurring_total_price)).setText(test.getItem_total());
viewHolder.divider = (TextView) view.findViewById(R.id.divider);
viewHolder.container.addView(view);
}
return convertView;
}
我正在使用自定义 listview
,它有 2 种不同的单项布局。
我的 json 数据:
{
"status": "success",
"response": [
{
"store_id": "1",
"store_name": "Prashant Stores",
"items": [
{
"item_id": "1",
"item_name": "Kellogs Cornflakes",
"item_price": "75",
"item_size": "500 mg",
"item_quantity": "1",
"item_total": "75",
"delivery_boy_status_id": "3",
"delivery_boy_status": "Delivered",
"is_available": "1"
},
{
"item_id": "2",
"item_name": "Chocos",
"item_price": "75",
"item_size": "1 kg",
"item_quantity": "1",
"item_total": "75",
"delivery_boy_status_id": "3",
"delivery_boy_status": "Delivered",
"is_available": "1"
}
]
},
{
"store_id": "5",
"store_name": "Corner Stores",
"items": [
{
"item_id": "4",
"item_name": "Chocos",
"item_price": "400",
"item_size": "1 kg",
"item_quantity": "1",
"item_total": "400",
"delivery_boy_status_id": "1",
"delivery_boy_status": "To be Collected",
"is_available": "1"
}
]
}
],
"message": ""
}
所需输出:
hashMap = new HashMap<>();
jsonObj = userFunction.getCustomerWiseDetails(deliveryBoyID, token, orderID);
Log.e(TAG, jsonObj.toString());
status = jsonObj.getString("status");
message = jsonObj.getString("message");
if (status.equalsIgnoreCase("success")) {
jsonArray = jsonObj.getJSONArray("response");
for (int i = 0; i < jsonArray.length(); i++) {
customerwiseDetailsListData = new ArrayList<>();
// customerwiseDetailsModel1.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
// customerwiseDetailsModel1.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
JSONObject jsonObjResponse = jsonArray.getJSONObject(i);
JSONArray jsonArrayItem = jsonObjResponse.getJSONArray("items");
for (int j = 0; j < jsonArrayItem.length(); j++) {
customerwiseDetailsModel = new CustomerwiseDetailsModel();
customerwiseDetailsModel.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
customerwiseDetailsModel.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
customerwiseDetailsModel.setItem_id(jsonArrayItem.getJSONObject(j).getString("item_id"));
customerwiseDetailsModel.setItem_name(jsonArrayItem.getJSONObject(j).getString("item_name"));
customerwiseDetailsModel.setItem_price(jsonArrayItem.getJSONObject(j).getString("item_price"));
customerwiseDetailsModel.setItem_size(jsonArrayItem.getJSONObject(j).getString("item_size"));
customerwiseDetailsModel.setItem_quantity(jsonArrayItem.getJSONObject(j).getString("item_quantity"));
customerwiseDetailsModel.setItem_total(jsonArrayItem.getJSONObject(j).getString("item_total"));
customerwiseDetailsModel.setDelivery_boy_status_id(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status_id"));
customerwiseDetailsModel.setDelivery_boy_status(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status"));
customerwiseDetailsModel.setIs_available(jsonArrayItem.getJSONObject(j).getString("is_available"));
if (j == (jsonArrayItem.length() - 1))
customerwiseDetailsModel.visible = "0";
else
customerwiseDetailsModel.visible = "1";
customerwiseDetailsListData.add(customerwiseDetailsModel);
hashMap.put(i, customerwiseDetailsListData);
}
}
我的适配器
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
itemsData = hasMap.get(position);
Log.d(TAG," hasMap "+hasMap.toString());
ViewHolder viewHolder;
View view = null;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = inflater.inflate(R.layout.listview_row_neworders_customer_wise_details, null, false);
viewHolder.txt_store_name = (TextView) convertView.findViewById(R.id.storename);
viewHolder.container = (LinearLayout) convertView.findViewById(R.id.neworders_customer_wise_details_container);
for (int i=0;i<itemsData.size();i++){
CustomerwiseDetailsModel test = itemsData.get(i);
Log.d(TAG," test "+itemsData.get(i).getStore_name());
view = inflater.inflate(R.layout.neworders_customer_wise_details_linearlayout, null);
viewHolder.txt_item_name = (TextView) view.findViewById(R.id.txt_product_name);
viewHolder.txt_item_size = (TextView) view.findViewById(R.id.txt_product_weight);
viewHolder.txt_item_quantity = (TextView) view.findViewById(R.id.txt_recurring_total_price_qnty);
viewHolder.txt_item_total = (TextView) view.findViewById(R.id.txt_recurring_total_price);
viewHolder.divider = (TextView) view.findViewById(R.id.divider);
viewHolder.container.addView(view);
viewHolder.txt_store_name.setText(test.getStore_name());
viewHolder.txt_item_name.setText(test.getItem_name());
viewHolder.txt_item_size.setText(test.getItem_size());
viewHolder.txt_item_quantity.setText(test.getItem_price() + " x" + test.getItem_quantity());
viewHolder.txt_item_total.setText(test.getItem_total());
}
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
return convertView;
}
何时滚动我的 listview
列表中的最后一项没有给我数据的更新值。
我看到列表中的第 2 个项目值与最后一个重复。
我的异步任务
class GetCustomerWiseDetails extends AsyncTask<Void, Void, String> {
String status, message;
JSONArray jsonArray;
JSONObject jsonItems;
String deliveryBoyID, token;
@Override
protected void onPreExecute() {
super.onPreExecute();
error_flag = 0;
listviewCustomerWiseDetails.setVisibility(View.VISIBLE);
error_layout.setVisibility(View.INVISIBLE);
img_no_internet.setVisibility(View.INVISIBLE);
img_no_results.setVisibility(View.INVISIBLE);
img_server_error.setVisibility(View.INVISIBLE);
progressDialog.setMessage("Getting customers ...");
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(true);
progressDialog.show();
deliveryBoyID = utilClass.getSharePerefernce(CustomerwiseDetailsActivity.this, UtilClass.KEY_DELIVETY_BY_ID, "0");
token = utilClass.getSharePerefernce(CustomerwiseDetailsActivity.this, UtilClass.KEY_TOKEN, "0");
}
@Override
protected String doInBackground(Void... params) {
if (NetworkCheck.isNetworkAvailable(CustomerwiseDetailsActivity.this)) {
try {
hashMap = new HashMap<>();
jsonObj = userFunction.getCustomerWiseDetails(deliveryBoyID, token, orderID);
Log.e(TAG, jsonObj.toString());
status = jsonObj.getString("status");
message = jsonObj.getString("message");
if (status.equalsIgnoreCase("success")) {
jsonArray = jsonObj.getJSONArray("response");
for (int i = 0; i < jsonArray.length(); i++) {
customerwiseDetailsListData = new ArrayList<>();
// customerwiseDetailsModel1.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
// customerwiseDetailsModel1.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
JSONObject jsonObjResponse = jsonArray.getJSONObject(i);
JSONArray jsonArrayItem = jsonObjResponse.getJSONArray("items");
for (int j = 0; j < jsonArrayItem.length(); j++) {
customerwiseDetailsModel = new CustomerwiseDetailsModel();
customerwiseDetailsModel.setStore_id(jsonArray.getJSONObject(i).getString("store_id"));
customerwiseDetailsModel.setStore_name(jsonArray.getJSONObject(i).getString("store_name"));
customerwiseDetailsModel.setItem_id(jsonArrayItem.getJSONObject(j).getString("item_id"));
customerwiseDetailsModel.setItem_name(jsonArrayItem.getJSONObject(j).getString("item_name"));
customerwiseDetailsModel.setItem_price(jsonArrayItem.getJSONObject(j).getString("item_price"));
customerwiseDetailsModel.setItem_size(jsonArrayItem.getJSONObject(j).getString("item_size"));
customerwiseDetailsModel.setItem_quantity(jsonArrayItem.getJSONObject(j).getString("item_quantity"));
customerwiseDetailsModel.setItem_total(jsonArrayItem.getJSONObject(j).getString("item_total"));
customerwiseDetailsModel.setDelivery_boy_status_id(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status_id"));
customerwiseDetailsModel.setDelivery_boy_status(jsonArrayItem.getJSONObject(j).getString("delivery_boy_status"));
customerwiseDetailsModel.setIs_available(jsonArrayItem.getJSONObject(j).getString("is_available"));
if (j == (jsonArrayItem.length() - 1))
customerwiseDetailsModel.visible = "0";
else
customerwiseDetailsModel.visible = "1";
customerwiseDetailsListData.add(customerwiseDetailsModel);
hashMap.put(i, customerwiseDetailsListData);
}
}
} else if (status.equalsIgnoreCase("invalid parameters")) {
error_flag = 2;
Log.e(TAG, "invalid parameters");
} else if (status.equalsIgnoreCase("invalid user")) {
error_flag = 3;
Log.e(TAG, "No Data");
} else if (status.equalsIgnoreCase("error")) {
error_flag = 3;
Log.e(TAG, "No Data");
}
Log.e(TAG, "****** status " + status);
return String.valueOf(jsonObj);
} catch (Exception e) {
status = "Error";
error_flag = 2;
Log.e(TAG, e.toString());
}
} else {
error_flag = 1;
Log.e(TAG, "Network Error");
}
return null;
}
@Override
protected void onPostExecute(String response) {
super.onPostExecute(response);
Log.e(TAG, " **** error **** " + error_flag);
if (error_flag == 1) {
listviewCustomerWiseDetails.setVisibility(View.GONE);
error_layout.setVisibility(View.VISIBLE);
img_no_internet.setVisibility(View.VISIBLE);
} else if (error_flag == 2) {
listviewCustomerWiseDetails.setVisibility(View.GONE);
error_layout.setVisibility(View.VISIBLE);
img_server_error.setVisibility(View.VISIBLE);
} else if (error_flag == 3) {
listviewCustomerWiseDetails.setVisibility(View.GONE);
error_layout.setVisibility(View.VISIBLE);
img_no_results.setVisibility(View.VISIBLE);
} else if (error_flag == 0) {
customerwiseDeatilsAdapter = new CustomerwiseDeatilsAdapter(CustomerwiseDetailsActivity.this, hashMap);
listviewCustomerWiseDetails.setAdapter(customerwiseDeatilsAdapter);
customerwiseDeatilsAdapter.notifyDataSetChanged();
}
if ((progressDialog != null) && progressDialog.isShowing()) {
progressDialog.dismiss();
}
progressDialog = null;
}
}
在你的 activity 循环之后,写下这行:
myAdapter.notifyDataSetChanged();
重写你的代码如下
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
itemsData = hasMap.get(position);
Log.d(TAG," hasMap "+hasMap.toString());
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = inflater.inflate(R.layout.listview_row_neworders_customer_wise_details, null, false);
viewHolder.txt_store_name = (TextView) convertView.findViewById(R.id.storename);
viewHolder.container = (LinearLayout) convertView.findViewById(R.id.neworders_customer_wise_details_container);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.container.removeAllViews();
for (int i=0;i<itemsData.size();i++){
CustomerwiseDetailsModel test = itemsData.get(i);
viewHolder.txt_store_name.setText(test.getStore_name());
Log.d(TAG," test "+itemsData.get(i).getStore_name());
View view = inflater.inflate(R.layout.neworders_customer_wise_details_linearlayout, null);
((TextView) view.findViewById(R.id.txt_product_name)).setText(test.getItem_name());
((TextView) view.findViewById(R.id.txt_product_weight)).setText(test.getItem_size());
((TextView) view.findViewById(R.id.txt_recurring_total_price_qnty)).setText(test.getItem_price() + " x" + test.getItem_quantity());
((TextView) view.findViewById(R.id.txt_recurring_total_price)).setText(test.getItem_total());
viewHolder.divider = (TextView) view.findViewById(R.id.divider);
viewHolder.container.addView(view);
}
return convertView;
}