Friday 15 June 2012

android - EditText is gone but values remain in memory -


I have some edit boxes arranged on rows and columns. Those editing techniques have product name, quantity and value and a text view that shows in real-time (whenever you write on one of the EditTexts each time it counts) I have set up the AA button in each row, when click My problem with moving the set visibility (3EditTexts for product name, price and quantity) is that even when I set the visibility, even though no more is edited anymore Is also calculated before calculating their values.

My question is now, what happens when EditTexts are set to visibility? My app counts in real time, so when something happens with an editing text, it re-calculates..but it's still like the value ... Is it between invisible and moved Is not the difference considered?

I show you the way you calculate (even after pressing the X button to edit it, even when you change the value within EditTexts, also called) < / P>

  Public Zero Calculus () {Slotting = 0; Prod = new string [allprod.size ()]; Pret = new string [allpret.size ()]; Cant = new string [allcant.size ()]; For (int m = 0; m & lt; allprod.size (); m ++) {prod [m] = allprod.get (m) .gettext (). ToString (); If (prod [m] .mats ("")) {prod [m] = "-"; }} For (int j = 0; j & lt; allcant.size (); j ++) {cant [j] = allcant.get (j) .gettext (). ToString (); If (Cant [j] matches ("")) {Cant [j] = float. Toasting (0); }} For (int k = 0; k & lt; allpret.size (); k ++) {pret [k] = allpret.get (k) .gettext (). ToString (); If (pret [k] .matches ("")) {pret [k] = Float.toString (0); }} For (int l = 0; l & lt; allpret.size (); l ++) {Float floating = float. Parsfalotte (Cant [L]) * Float .Preceflot (pret [l]); Total = Total + Floating; TextView totalf = (TextView) findViewById (R.id.total); Totalf.setText (string format ("total:% .2f", cholataste));  

P>
  view Gene This view is invisible, and it does not take any space for the purposes of the layout. See. INVISIBLE This view is invisible, but it still takes place for layout purposes.   

This also preserves the EditText object even after gone .

If you If you do not want to, you can start the Editte again ... to maintain its value ... or setText = ""

The only difference is above the quote. .

Hope it helps ...

No comments:

Post a Comment