I have edit text in my app to manipulate product quantity, but the issue if I will change the quantity , on that time getting NPE. to change the quantity in edit text I need to remove existing and need to add a new one, please check following code
viewHolder.edt_product_qty.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
quantity_count= Integer.parseInt(viewHolder.edt_product_qty.getText().toString());
buyNowList(user_id,"UserCart",0,stList.get(position).getCartList1().getId(),stList.get(position).getCartList1().getProdSku(),stList.get(position).getCartList1().getProdId(),quantity_count,0,qty_status,stList.get(position).getCartList1().getProdPrice());
}
@Override
public void afterTextChanged(Editable editable) {
}
});