title: check editText with arraylist and not let user to enter the same data
body: <p>User can add product &amp; qty from <code>EditText</code> , which gets displayed in <code>ListView</code>  on ADD button pressed, now i don't want user to enter the same product again..fetched data from DB... Need help,find code below!</p>
  
  <pre><code>addBtn.setOnClickListener(new View.OnClickListener() {
  
                 public void onClick(View v) {
                      String nullProduct = product.getText().toString();
                       nullQuant = quantity.getText().toString();
  
                      if (nullProduct.matches("") || nullQuant.matches("")) {
                          Toast.makeText(InvoiceView.this, "Please choose Product and Quantity", Toast.LENGTH_LONG).show();
                          return;
                      } else {
  
                          quant = Integer.parseInt(quantity.getText().toString());      // Calculation of quantity + unit price
                          unitprice = Double.parseDouble(prounitprice);
                          result = quant * unitprice;
                          Result = String.valueOf(result);
                                                  // Total value of sales order
                          Map&lt;String, String&gt; dataFinal = new HashMap&lt;String, String&gt;();
                          dataFinal.put("A", proname);
                          dataFinal.put("B", String.valueOf(quant));
                          dataFinal.put("C", String.valueOf(unitprice));
                          dataFinal.put("D", Result);
                          proFinal.add(dataFinal);
  
                          String[] from = {"A", "B", "C", "D"};
                          int[] listviews = {R.id.lblproname, R.id.lblproqty, R.id.lblprorate, R.id.lblprototal};
                          final SimpleAdapter ADA = new SimpleAdapter(InvoiceView.this,
                                  proFinal, R.layout.lsttemplate, from,
                                  listviews);
                          lstpro.setAdapter(ADA);
  
                          int count = proFinal.size();
                          for (int i = 0; i &lt; count; i++) {
  
                              HashMap&lt;String, String&gt; map = (HashMap&lt;String, String&gt;) proFinal.get(i);
                              String sValue;
                              if (proFinal.size() &gt; 1) {
                                  sValue = map.get("A");
                                  if (nullProduct.equals(sValue)) {
                                      Toast.makeText(InvoiceView.this, "Product already added", Toast.LENGTH_SHORT).show();
                                  } else {
                               // incomplete code section
  
                                  }
                              }
                          }
                          }                      
                          product.setText("");
                          quantity.setText("");
  
                  }
              });
  
      }
  </code></pre>