title: Android EditText has fixed input
body: <p>This part of my program is supposed to be a user input field for the quantity of an item to purchase. What I'm unable to do is to make it so when the program finally runs on the emulator and I change the textfield number in the EditText, named "etxtQuantity" in my case, the number I use is ignored and it reverts to using the default entry. Also my if statement isn't working like I expect either, it accepts everything.</p>
  
  <pre><code>private void setupAddRecordButton() {
  
      Button button = (Button) findViewById(R.id.btnAddCart);
  
      button.setOnClickListener(new View.OnClickListener() {
  
          final TextView countText = (TextView) findViewById(R.id.txtAddCartCount);
          EditText quantity = (EditText) findViewById(R.id.etxtQuantity);
          String quantity2 = quantity.getText().toString();
          final TextView text2 = (TextView) findViewById(R.id.txtQuantityCheck); 
  
          @Override
          public void onClick(View v) {
  
              if (! quantity2.equals(".") || quantity2.equals("") || quantity2.equals("-")) {
                  count++;
                  long newId = myDb.insertRow("GTX 950", 140, quantity2);
                  myDb.getRow(newId);
                  countText.setText("Successfully added " + count + " Times");
              }
              else
              {
                  text2.setText("Quantity needed!");
              }
          }
      });
  }
  </code></pre>