Страница 1 из 1

нужно ссумировать кучу чисел...

Добавлено: 10 мар 2014, 19:25
АндрЕвгений
Здравствуйте, дорогие форумчане! :)

Проблема такова: необходимо написать прогу, которая бы в реальном времени показывала сумму чисел вводимых в текстовые поля... Так вот, таких полей у меня 90 и 91-ое для вывода суммы. Приложение перестало запускаться после написания кода для 66 текстового поля... Код слишком громоздкий, т.к. пришлось писать TextWatcher полностью для кажлого поля.. И вот такая жесть получилась... как можно упростить код? Заранее благодарю за помощь :)

Код: Выделить всё

import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

public class MainActivity extends Activity {
	
	private static final String NUM_1 = "NUM_1";   private static final String NUM_2 = "NUM_2";
	private static final String NUM_3 = "NUM_3";   private static final String NUM_4 = "NUM_4";
	private static final String NUM_5 = "NUM_5";   private static final String NUM_6 = "NUM_6";
	private static final String NUM_7 = "NUM_7";   private static final String NUM_8 = "NUM_8";
	private static final String NUM_9 = "NUM_9";   private static final String NUM_10 = "NUM_10";
	private static final String NUM_11 = "NUM_11"; private static final String NUM_12 = "NUM_12";
	private static final String NUM_13 = "NUM_13"; private static final String NUM_14 = "NUM_14";
	private static final String NUM_15 = "NUM_15"; private static final String NUM_16 = "NUM_16";
	private static final String NUM_17 = "NUM_17"; private static final String NUM_18 = "NUM_18";
	private static final String NUM_19 = "NUM_19"; private static final String NUM_20 = "NUM_20";
	private static final String NUM_21 = "NUM_21"; private static final String NUM_22 = "NUM_22";
	private static final String NUM_23 = "NUM_23"; private static final String NUM_24 = "NUM_24";
	private static final String NUM_25 = "NUM_25"; private static final String NUM_26 = "NUM_26";
	private static final String NUM_27 = "NUM_27"; private static final String NUM_28 = "NUM_28";
	private static final String NUM_29 = "NUM_29"; private static final String NUM_30 = "NUM_30";
	private static final String NUM_31 = "NUM_31"; private static final String NUM_32 = "NUM_32";
	private static final String NUM_33 = "NUM_33"; private static final String NUM_34 = "NUM_34";
	private static final String NUM_35 = "NUM_35"; private static final String NUM_36 = "NUM_36";
	private static final String NUM_37 = "NUM_37"; private static final String NUM_38 = "NUM_38";
	private static final String NUM_39 = "NUM_39"; private static final String NUM_40 = "NUM_40";
	private static final String NUM_41 = "NUM_41"; private static final String NUM_42 = "NUM_42";
	private static final String NUM_43 = "NUM_43"; private static final String NUM_44 = "NUM_44";
	private static final String NUM_45 = "NUM_45"; private static final String NUM_46 = "NUM_46";
	private static final String NUM_47 = "NUM_47"; private static final String NUM_48 = "NUM_48";
	private static final String NUM_49 = "NUM_49"; private static final String NUM_50 = "NUM_50";
	private static final String NUM_51 = "NUM_51"; private static final String NUM_52 = "NUM_52";
	private static final String NUM_53 = "NUM_53"; private static final String NUM_54 = "NUM_54";
	private static final String NUM_55 = "NUM_55"; private static final String NUM_56 = "NUM_56";
	private static final String NUM_57 = "NUM_57"; private static final String NUM_58 = "NUM_58";
	private static final String NUM_59 = "NUM_59"; private static final String NUM_60 = "NUM_60";
	private static final String NUM_61 = "NUM_61"; private static final String NUM_62 = "NUM_62";
	private static final String NUM_63 = "NUM_63"; private static final String NUM_64 = "NUM_64";
	private static final String NUM_65 = "NUM_65"; private static final String NUM_66 = "NUM_66";
	double num1;  double num2;  double num3;
	double num4;  double num5;  double num6; 
	double num7;  double num8;  double num9;
	double num10; double num11; double num12;
	double num13; double num14; double num15;
	double num16; double num17; double num18;
	double num19; double num20; double num21;
	double num22; double num23; double num24;
	double num25; double num26; double num27;
	double num28; double num29; double num30;
	double num31; double num32; double num33;
	double num34; double num35; double num36;
	double num37; double num38; double num39;
	double num40; double num41; double num42;
	double num43; double num44; double num45;
	double num46; double num47; double num48;
	double num49; double num50; double num51;
	double num52; double num53; double num54;
	double num55; double num56; double num57;
	double num58; double num59; double num60;
	double num61; double num62; double num63;
	double num64; double num65; double num66;
	EditText etN1, etN2, etN3, etN4, etN5, etN6, etN7, etN8, etN9, etN10, etN11, etN12, etN13, etN14, etN15, etN16, etN17, etN18, etN19, etN20, etN21, etN22, etN23, etN24, etN25, etN26, etN27, etN28, etN29, etN30, etTotAt, etTotDeff;
	EditText etN31, etN32, etN33, etN34, etN35, etN36, etN37, etN38, etN39, etN40, etN41, etN42, etN43, etN44, etN45, etN46, etN47, etN48, etN49, etN50, etN51, etN52, etN53, etN54, etN55, etN56, etN57, etN58, etN59, etN60;
	EditText etN61, etN62, etN63, etN64, etN65, etN66;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.nime);
		if ( savedInstanceState == null ) {
			num1 = 0;  num2 = 0;  num3 = 0;  num4 = 0;  num5 = 0;  num6 = 0;
			num7 = 0;  num8 = 0;  num9 = 0;  num10 = 0; num11 = 0; num12 =0;
			num13 = 0; num14 = 0; num15 = 0; num16 = 0; num17 = 0; num18 = 0;
			num19 = 0; num20 = 0; num21 = 0; num22 = 0; num23 = 0; num24 = 0;
			num25 = 0; num26 = 0; num27 = 0; num28 = 0; num29 = 0; num30 = 0;
			num31 = 0; num32 = 0; num33 = 0; num34 = 0; num35 = 0; num36 = 0;
			num37 = 0; num38 = 0; num39 = 0; num40 = 0; num41 = 0; num42 = 0;
			num43 = 0; num44 = 0; num45 = 0; num46 = 0; num47 = 0; num48 = 0;
			num49 = 0; num50 = 0; num51 = 0; num52 = 0; num53 = 0; num54 = 0;
			num55 = 0; num56 = 0; num57 = 0; num58 = 0; num59 = 0; num60 = 0;
			num61 = 0; num62 = 0; num63 = 0; num64 = 0; num65 = 0; num66 = 0;
		}
		else {
			num1 = savedInstanceState.getDouble(NUM_1);   num2 = savedInstanceState.getDouble(NUM_2);
			num3 = savedInstanceState.getDouble(NUM_3);   num4 = savedInstanceState.getDouble(NUM_4);
			num5 = savedInstanceState.getDouble(NUM_5);   num6 = savedInstanceState.getDouble(NUM_6);
			num7 = savedInstanceState.getDouble(NUM_7);   num8 = savedInstanceState.getDouble(NUM_8);
			num9 = savedInstanceState.getDouble(NUM_9);   num10 = savedInstanceState.getDouble(NUM_10);
			num11 = savedInstanceState.getDouble(NUM_11); num12 = savedInstanceState.getDouble(NUM_12);
			num13 = savedInstanceState.getDouble(NUM_13); num14 = savedInstanceState.getDouble(NUM_14);
			num15 = savedInstanceState.getDouble(NUM_15); num16 = savedInstanceState.getDouble(NUM_16);
			num17 = savedInstanceState.getDouble(NUM_17); num18 = savedInstanceState.getDouble(NUM_18);
			num19 = savedInstanceState.getDouble(NUM_19); num20 = savedInstanceState.getDouble(NUM_20);
			num21 = savedInstanceState.getDouble(NUM_21); num22 = savedInstanceState.getDouble(NUM_22);
			num23 = savedInstanceState.getDouble(NUM_23); num24 = savedInstanceState.getDouble(NUM_24);
			num25 = savedInstanceState.getDouble(NUM_25); num26 = savedInstanceState.getDouble(NUM_26);
			num27 = savedInstanceState.getDouble(NUM_27); num28 = savedInstanceState.getDouble(NUM_28);
			num29 = savedInstanceState.getDouble(NUM_29); num30 = savedInstanceState.getDouble(NUM_30);
			num31 = savedInstanceState.getDouble(NUM_31); num32 = savedInstanceState.getDouble(NUM_32);
			num33 = savedInstanceState.getDouble(NUM_33); num34 = savedInstanceState.getDouble(NUM_34);
			num35 = savedInstanceState.getDouble(NUM_35); num36 = savedInstanceState.getDouble(NUM_36);
			num37 = savedInstanceState.getDouble(NUM_37); num38 = savedInstanceState.getDouble(NUM_38);
			num39 = savedInstanceState.getDouble(NUM_39); num40 = savedInstanceState.getDouble(NUM_40);
			num41 = savedInstanceState.getDouble(NUM_41); num42 = savedInstanceState.getDouble(NUM_42);
			num43 = savedInstanceState.getDouble(NUM_43); num44 = savedInstanceState.getDouble(NUM_44);
			num45 = savedInstanceState.getDouble(NUM_45); num46 = savedInstanceState.getDouble(NUM_46);
			num47 = savedInstanceState.getDouble(NUM_47); num48 = savedInstanceState.getDouble(NUM_48);
			num49 = savedInstanceState.getDouble(NUM_49); num50 = savedInstanceState.getDouble(NUM_50);
			num51 = savedInstanceState.getDouble(NUM_51); num52 = savedInstanceState.getDouble(NUM_52);
			num53 = savedInstanceState.getDouble(NUM_53); num54 = savedInstanceState.getDouble(NUM_54);
			num55 = savedInstanceState.getDouble(NUM_55); num56 = savedInstanceState.getDouble(NUM_56);
			num57 = savedInstanceState.getDouble(NUM_57); num58 = savedInstanceState.getDouble(NUM_58);
			num59 = savedInstanceState.getDouble(NUM_59); num60 = savedInstanceState.getDouble(NUM_60);
			num61 = savedInstanceState.getDouble(NUM_61); num62 = savedInstanceState.getDouble(NUM_62);
			num63 = savedInstanceState.getDouble(NUM_63); num64 = savedInstanceState.getDouble(NUM_64);
			num65 = savedInstanceState.getDouble(NUM_65); num66 = savedInstanceState.getDouble(NUM_66);
		}
		etN1 = (EditText)findViewById(R.id.editText1); etN1.addTextChangedListener(billEditTextWatcher);
		etN2 = (EditText)findViewById(R.id.editText2); etN2.addTextChangedListener(num2EditTextWatcher);
		etN3 = (EditText)findViewById(R.id.editText3); etN3.addTextChangedListener(num3EditTextWatcher);
		etN4 = (EditText)findViewById(R.id.editText4); etN4.addTextChangedListener(num4EditTextWatcher);
		etN5 = (EditText)findViewById(R.id.editText5); etN5.addTextChangedListener(num5EditTextWatcher);
		etN6 = (EditText)findViewById(R.id.editText6); etN6.addTextChangedListener(num6EditTextWatcher);
		etN7 = (EditText)findViewById(R.id.editText7); etN7.addTextChangedListener(num7EditTextWatcher);
		etN8 = (EditText)findViewById(R.id.editText8); etN8.addTextChangedListener(num8EditTextWatcher);
		etN9 = (EditText)findViewById(R.id.editText9); etN9.addTextChangedListener(num9EditTextWatcher);
		etN10 = (EditText)findViewById(R.id.editText10); etN10.addTextChangedListener(num10EditTextWatcher);
		etN11 = (EditText)findViewById(R.id.editText11); etN11.addTextChangedListener(num11EditTextWatcher);
		etN12 = (EditText)findViewById(R.id.editText12); etN12.addTextChangedListener(num12EditTextWatcher);
		etN13 = (EditText)findViewById(R.id.editText13); etN13.addTextChangedListener(num13EditTextWatcher);
		etN14 = (EditText)findViewById(R.id.editText14); etN14.addTextChangedListener(num14EditTextWatcher);
		etN15 = (EditText)findViewById(R.id.editText15); etN15.addTextChangedListener(num15EditTextWatcher);
		etN16 = (EditText)findViewById(R.id.editText16); etN16.addTextChangedListener(num16EditTextWatcher);
		etN17 = (EditText)findViewById(R.id.editText17); etN17.addTextChangedListener(num17EditTextWatcher);
		etN18 = (EditText)findViewById(R.id.editText18); etN18.addTextChangedListener(num18EditTextWatcher);
		etN19 = (EditText)findViewById(R.id.editText19); etN19.addTextChangedListener(num19EditTextWatcher);
		etN20 = (EditText)findViewById(R.id.editText20); etN20.addTextChangedListener(num20EditTextWatcher);
		etN21 = (EditText)findViewById(R.id.editText21); etN21.addTextChangedListener(num21EditTextWatcher);
		etN22 = (EditText)findViewById(R.id.editText22); etN22.addTextChangedListener(num22EditTextWatcher);
		etN23 = (EditText)findViewById(R.id.editText23); etN23.addTextChangedListener(num23EditTextWatcher);
		etN24 = (EditText)findViewById(R.id.editText24); etN24.addTextChangedListener(num24EditTextWatcher);
		etN25 = (EditText)findViewById(R.id.editText25); etN25.addTextChangedListener(num25EditTextWatcher);
		etN26 = (EditText)findViewById(R.id.editText26); etN26.addTextChangedListener(num26EditTextWatcher);
		etN27 = (EditText)findViewById(R.id.editText27); etN27.addTextChangedListener(num27EditTextWatcher);
		etN28 = (EditText)findViewById(R.id.editText28); etN28.addTextChangedListener(num28EditTextWatcher);
		etN29 = (EditText)findViewById(R.id.editText29); etN29.addTextChangedListener(num29EditTextWatcher);
		etN30 = (EditText)findViewById(R.id.editText30); etN30.addTextChangedListener(num30EditTextWatcher);
		etN31 = (EditText)findViewById(R.id.editText31); etN31.addTextChangedListener(num31EditTextWatcher);
		etN32 = (EditText)findViewById(R.id.editText32); etN32.addTextChangedListener(num32EditTextWatcher);
		etN33 = (EditText)findViewById(R.id.editText33); etN33.addTextChangedListener(num33EditTextWatcher);
		etN34 = (EditText)findViewById(R.id.editText34); etN34.addTextChangedListener(num34EditTextWatcher);
		etN35 = (EditText)findViewById(R.id.editText35); etN35.addTextChangedListener(num35EditTextWatcher);
		etN36 = (EditText)findViewById(R.id.editText36); etN36.addTextChangedListener(num36EditTextWatcher);
		etN37 = (EditText)findViewById(R.id.editText37); etN37.addTextChangedListener(num37EditTextWatcher);
		etN38 = (EditText)findViewById(R.id.editText38); etN38.addTextChangedListener(num38EditTextWatcher);
		etN39 = (EditText)findViewById(R.id.editText39); etN39.addTextChangedListener(num39EditTextWatcher);
		etN40 = (EditText)findViewById(R.id.editText40); etN40.addTextChangedListener(num40EditTextWatcher);
		etN41 = (EditText)findViewById(R.id.editText41); etN41.addTextChangedListener(num41EditTextWatcher);
		etN42 = (EditText)findViewById(R.id.editText42); etN42.addTextChangedListener(num42EditTextWatcher);
		etN43 = (EditText)findViewById(R.id.editText43); etN43.addTextChangedListener(num43EditTextWatcher);
		etN44 = (EditText)findViewById(R.id.editText44); etN44.addTextChangedListener(num44EditTextWatcher);
		etN45 = (EditText)findViewById(R.id.editText45); etN45.addTextChangedListener(num45EditTextWatcher);
		etN46 = (EditText)findViewById(R.id.editText46); etN46.addTextChangedListener(num46EditTextWatcher);
		etN47 = (EditText)findViewById(R.id.editText47); etN47.addTextChangedListener(num47EditTextWatcher);
		etN48 = (EditText)findViewById(R.id.editText48); etN48.addTextChangedListener(num48EditTextWatcher);
		etN49 = (EditText)findViewById(R.id.editText49); etN49.addTextChangedListener(num49EditTextWatcher);
		etN50 = (EditText)findViewById(R.id.editText50); etN50.addTextChangedListener(num50EditTextWatcher);
		etN51 = (EditText)findViewById(R.id.editText51); etN51.addTextChangedListener(num51EditTextWatcher);
		etN52 = (EditText)findViewById(R.id.editText52); etN52.addTextChangedListener(num52EditTextWatcher);
		etN53 = (EditText)findViewById(R.id.editText53); etN53.addTextChangedListener(num53EditTextWatcher);
		etN54 = (EditText)findViewById(R.id.editText54); etN54.addTextChangedListener(num54EditTextWatcher);
		etN55 = (EditText)findViewById(R.id.editText55); etN55.addTextChangedListener(num55EditTextWatcher);
		etN56 = (EditText)findViewById(R.id.editText56); etN56.addTextChangedListener(num56EditTextWatcher);
		etN57 = (EditText)findViewById(R.id.editText57); etN57.addTextChangedListener(num57EditTextWatcher);
		etN58 = (EditText)findViewById(R.id.editText58); etN58.addTextChangedListener(num58EditTextWatcher);
		etN59 = (EditText)findViewById(R.id.editText59); etN59.addTextChangedListener(num59EditTextWatcher);
		etN60 = (EditText)findViewById(R.id.editText60); etN60.addTextChangedListener(num60EditTextWatcher);
		etN61 = (EditText)findViewById(R.id.editText61); etN61.addTextChangedListener(num61EditTextWatcher);
		etN62 = (EditText)findViewById(R.id.editText62); etN62.addTextChangedListener(num62EditTextWatcher);
		etN63 = (EditText)findViewById(R.id.editText63); etN63.addTextChangedListener(num63EditTextWatcher);
		etN64 = (EditText)findViewById(R.id.editText64); etN64.addTextChangedListener(num64EditTextWatcher);
		etN65 = (EditText)findViewById(R.id.editText65); etN65.addTextChangedListener(num65EditTextWatcher);
		etN66 = (EditText)findViewById(R.id.editText66); etN66.addTextChangedListener(num66EditTextWatcher);
		etTotAt = (EditText)findViewById(R.id.totAttack);
		etTotDeff = (EditText)findViewById(R.id.totDeff);
	}
	private void updateStandard(){
		double apop = num1 * 3700;   double dpop = num1 * 3500;
		double akrs = num2 * 3800;   double dkrs = num2 * 4500;
		double asht = num3 * 4700;   double dsht = num3 * 4800;
		double apal = num4 * 870;    double dpal = num4 * 800;
		double amoon = num5 * 950;   double dmoon = num5 * 1100;
		double akoron = num6 * 3000; double dkoron = num6 * 3000;
		double apika = num7 * 350;   double dpika = num7 * 330;
		double akamen = num8 * 480;  double dkamen = num8 * 550;
		double akoja = num9 * 700;   double dkoja = num9 * 650;
		double akopyo = num10 * 59;  double dkopyo = num10 * 53;
		double agreb = num11 * 100;  double dgreb = num11 * 120;
		double aparad = num12 * 220; double dparad = num12 * 220;
		double aostop = num13 * 102; double dostop = num13 * 80;
		double aches = num14 * 80;   double dches = num14 * 103;
		double akryl = num15 * 81;   double dkryl = num15 * 95;
		double aimph = num16 * 99;   double dimph = num16 * 71;
		double aimps = num17 * 75;   double dimps = num17 * 98;
		double abard = num18 * 99;   double dbard = num18 * 69;
		double aglef = num19 * 85;   double dglef = num19 * 70;
		double agolds = num20 * 80;  double dgolds = num20 * 80;
		double aplast = num21 * 66;  double dplast = num21 * 90;
		double ayat = num22 * 75;    double dyat = num22 * 72;
		double akap = num23 * 63;    double dkap = num23 * 85;
		double aibs = num24 * 70;    double dibs = num24 * 75;
		double abul = num25 * 80;    double dbul = num25 * 53;
		double aiks = num26 * 70;    double diks = num26 * 66;
		double aplr = num27 * 75;    double dplr = num27 * 55;
		double apik = num28 * 55;    double dpik = num28 * 68;
		double apav = num29 * 50;    double dpav = num29 * 75;
		double anap = num30 * 50;    double dnap = num30 * 72;
		double akley = num31 * 60;   double dkley = num31 * 50;
		double asvet = num32 * 54;   double dsvet = num32 * 61;
		double amax = num33 * 56;    double dmax = num33 * 53;
		double abek = num34 * 55;    double dbek = num34 * 49;
		double abar = num35 * 48;    double dbar = num35 * 58;
		double abev = num36 * 47;    double dbev = num36 * 53;
		double amast = num37 * 50;   double dmast = num37 * 44;
		double aslav = num38 * 42;   double dslav = num38 * 56;
		double achb = num39 * 46;    double dchb = num39 * 46;
		double aotr = num40 * 46;    double dotr = num40 * 40;
		double aogn = num41 * 42;    double dogn = num41 * 47;
		double astz = num42 * 44;    double dstz = num42 * 40;
		double asek = num43 * 43;    double dsek = num43 * 33;
		double arun = num44 * 36;    double drun = num44 * 43;
		double aspr = num45 * 34;    double dspr = num45 * 40;
		double amol = num46 * 37;    double dmol = num46 * 31;
		double afal = num47 * 33;    double dfal = num47 * 39;
		double apld = num48 * 32;    double dpld = num48 * 32;
		double advu = num49 * 33;    double ddvu = num49 * 27;
		double aorl = num50 * 28;    double dorl = num50 * 36;
		double azhb = num51 * 30;    double dzhb = num51 * 26;
		double aarb = num52 * 30;    double darb = num52 * 22;
		double ashd = num53 * 25;    double dshd = num53 * 29;
		double akol = num54 * 23;    double dkol = num54 * 25;
		double amorg = num55 * 23;   double dmorg = num55 * 19;
		double abrz = num56 * 18;    double dbrz = num56 * 24;
		double abash = num57 * 18;   double dbash = num57 * 22;
		double aale = num58 * 21;    double dale = num58 * 16;
		double ausi = num59 * 16;    double dusi = num59 * 22;
		double anaru = num60 * 17;   double dnaru = num60 * 17;
		double atom = num61 * 19;    double dtom = num61 * 11;
		double arys = num62 * 13;    double drys = num62 * 20;
		double apros = num63 * 16;   double dpros = num63 * 12;
		double aobt = num64 * 15;    double dobt = num64 * 9;
		double azas = num65 * 12;    double dzas = num65 * 15;
		double aklz = num66 * 10;    double dklz = num66 * 11;
		double atotal = apop + akrs + asht + apal + amoon + akoron + apika + akamen + akoja + akopyo + agreb + aparad + aostop + aches + akryl + aimph + aimps + abard + aglef + agolds + aplast + ayat + akap + aibs + abul + aiks + aplr + apik 
				+ apav + anap + akley + asvet + amax + abek + abar + abev + amast + aslav + achb + aotr + aogn + astz + asek + arun + aspr + amol + afal + apld + advu + aorl + azhb + aarb + ashd + akol + amorg + abrz + abash + aale + ausi + anaru + atom + arys + apros + aobt + azas + aklz;
		double dtotal = dpop + dkrs + dsht + dpal + dmoon + dkoron + dpika + dkamen + dkoja + dkopyo + dgreb + dparad + dostop + dches + dkryl + dimph + dimps + dbard + dglef + dgolds + dplast + dyat + dkap + dibs + dbul + diks + dplr + dpik 
				+ dpav + dnap + dkley + dsvet + dmax + dbek + dbar + dbev + dmast + dslav + dchb + dotr + dogn + dstz + dsek + drun + dspr + dmol + dfal + dpld + ddvu + dorl + dzhb + darb + dshd + dkol + dmorg + dbrz + dbash + dale + dusi + dnaru + dtom + drys + dpros + dobt + dzas + dklz;
		etTotAt.setText(String.format("%.00f", atotal));
		etTotDeff.setText(String.format("%.00f", dtotal));
	}
	
	@Override
	   protected void onSaveInstanceState(Bundle outState)
	   {
	      super.onSaveInstanceState(outState);
	      
	      outState.putDouble(NUM_1, num1);   outState.putDouble(NUM_11, num11);  outState.putDouble(NUM_21, num21); outState.putDouble(NUM_31, num31); outState.putDouble(NUM_41, num41); outState.putDouble(NUM_51, num51); outState.putDouble(NUM_61, num61);
	      outState.putDouble(NUM_2, num2);   outState.putDouble(NUM_12, num12);  outState.putDouble(NUM_22, num22); outState.putDouble(NUM_32, num32); outState.putDouble(NUM_42, num42); outState.putDouble(NUM_52, num52); outState.putDouble(NUM_62, num62);
	      outState.putDouble(NUM_3, num3);   outState.putDouble(NUM_13, num13);  outState.putDouble(NUM_23, num23); outState.putDouble(NUM_33, num33); outState.putDouble(NUM_43, num43); outState.putDouble(NUM_53, num53); outState.putDouble(NUM_63, num63);
	      outState.putDouble(NUM_4, num4);   outState.putDouble(NUM_14, num14);  outState.putDouble(NUM_24, num24); outState.putDouble(NUM_34, num34); outState.putDouble(NUM_44, num44); outState.putDouble(NUM_54, num54); outState.putDouble(NUM_64, num64);
	      outState.putDouble(NUM_5, num5);   outState.putDouble(NUM_15, num15);  outState.putDouble(NUM_25, num25); outState.putDouble(NUM_35, num35); outState.putDouble(NUM_45, num45); outState.putDouble(NUM_55, num55); outState.putDouble(NUM_65, num65);
	      outState.putDouble(NUM_6, num6);   outState.putDouble(NUM_16, num16);  outState.putDouble(NUM_26, num26); outState.putDouble(NUM_36, num36); outState.putDouble(NUM_46, num46); outState.putDouble(NUM_56, num56); outState.putDouble(NUM_66, num66);
	      outState.putDouble(NUM_7, num7);   outState.putDouble(NUM_17, num17);  outState.putDouble(NUM_27, num27); outState.putDouble(NUM_37, num37); outState.putDouble(NUM_47, num47); outState.putDouble(NUM_57, num57);  
	      outState.putDouble(NUM_8, num8);   outState.putDouble(NUM_18, num18);  outState.putDouble(NUM_28, num28); outState.putDouble(NUM_38, num38); outState.putDouble(NUM_48, num48); outState.putDouble(NUM_58, num58); 
	      outState.putDouble(NUM_9, num9);   outState.putDouble(NUM_19, num19);  outState.putDouble(NUM_29, num29); outState.putDouble(NUM_39, num39); outState.putDouble(NUM_49, num49); outState.putDouble(NUM_59, num59); 
	      outState.putDouble(NUM_10, num10); outState.putDouble(NUM_20, num20);  outState.putDouble(NUM_30, num30); outState.putDouble(NUM_40, num40); outState.putDouble(NUM_50, num50); outState.putDouble(NUM_60, num60); 
	   }
	private TextWatcher billEditTextWatcher = new TextWatcher() 
	   {

	      @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count)  {   
	    	  try { num1 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num1 = 0.0; }
		       updateStandard();
	      }

	      @Override
	      public void afterTextChanged(Editable s) {
	   }

	      @Override
	      public void beforeTextChanged(CharSequence s, int start, int count,
	         int after) {}
	   };
	   
	   private TextWatcher num2EditTextWatcher = new TextWatcher() 
	   {

	      @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) 
	      {   
	    	  try {
		            num2 = Double.parseDouble(s.toString());
		         }
	    	  catch (NumberFormatException e){
	    		  num2 = 0.0;
	    	  }
		        

	         updateStandard();
	      }

	      @Override
	      public void afterTextChanged(Editable s) {
	   }

	      @Override
	      public void beforeTextChanged(CharSequence s, int start, int count,
	         int after) {}
	   };
	   
	   private TextWatcher num3EditTextWatcher = new TextWatcher() 
	   {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) {   
	    	  try {
		            num3 = Double.parseDouble(s.toString());
		         }
	    	  catch (NumberFormatException e){
	    		  num3 = 0.0;
	    	  }
		         updateStandard();
	      }

	      @Override
	      public void afterTextChanged(Editable s) {
	   }

	      @Override
	      public void beforeTextChanged(CharSequence s, int start, int count,
	         int after) {}
	   };
	   
	   private TextWatcher num4EditTextWatcher = new TextWatcher() 
	   {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) {   
	    	  try {
		            num4 = Double.parseDouble(s.toString());
		         }
	    	  catch (NumberFormatException e){
	    		  num4 = 0.0;
	    	  }
		         updateStandard();
	      }

	      @Override
	      public void afterTextChanged(Editable s) {
	   }

	      @Override
	      public void beforeTextChanged(CharSequence s, int start, int count,
	         int after) {}
	   };
	   
	   private TextWatcher num5EditTextWatcher = new TextWatcher() 
	   {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num5 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num5 = 0.0; }
		         updateStandard();
	      }

	      @Override
	      public void afterTextChanged(Editable s) { }

	      @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num6EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num6 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num6 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num7EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num7 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num7 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num8EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num8 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num8 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num9EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num9 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num9 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num10EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num10 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num10 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num11EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num11 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num11 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num12EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num12 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num12 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num13EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num13 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num13 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num14EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num14 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num14 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num15EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num15 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num15 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num16EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num16 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num16 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num17EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num17 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num17 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num18EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num18 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num18 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num19EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num19 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num19 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num20EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num20 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num20 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num21EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num21 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num21 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num22EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num22 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num22 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num23EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num23 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num23 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num24EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num24 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num24 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num25EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num25 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num25 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num26EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num26 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num26 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num27EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num27 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num27 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num28EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num28 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num28 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num29EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num29 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num29 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num30EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num30 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num30 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num31EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num31 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num31 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num32EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num32 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num32 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num33EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num33 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num33 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num34EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num34 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num34 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num35EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num35 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num35 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num36EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num36 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num36 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num37EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num37 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num37 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num38EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num38 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num38 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num39EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num39 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num39 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num40EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num40 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num40 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num41EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, 
	         int before, int count) { try { num41 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num41 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num42EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num42 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num42 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num43EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num43 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num43 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num44EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num44 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num44 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num45EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num45 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num45 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num46EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num46 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num46 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num47EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num47 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num47 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num48EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num48 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num48 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num49EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num49 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num49 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num50EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num50 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num50 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num51EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num51 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num51 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num52EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num52 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num52 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num53EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num53 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num53 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num54EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num54 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num54 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num55EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num55 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num55 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num56EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num56 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num56 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num57EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num57 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num57 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num58EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num58 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num58 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num59EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num59 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num59 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num60EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num60 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num60 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num61EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num61 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num61 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num62EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num62 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num62 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num63EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num63 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num63 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num64EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num64 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num64 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num65EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num65 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num65 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   
	   private TextWatcher num66EditTextWatcher = new TextWatcher() {
		   @Override
	      public void onTextChanged(CharSequence s, int start, int before, int count) { try { num66 = Double.parseDouble(s.toString()); }
	    	  catch (NumberFormatException e){ num66 = 0.0; }
		         updateStandard(); }
		  @Override
	      public void afterTextChanged(Editable s) { }
		  @Override
	      public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
	   };
	   	   
}
P.S. ошибок нет... видимо, просто загромоздил.

Re: нужно ссумировать кучу чисел...

Добавлено: 10 мар 2014, 20:32
Foenix
ого! :-D
и это пишет программист?
а вы в курсе, для чего изобрели программирование?

Re: нужно ссумировать кучу чисел...

Добавлено: 10 мар 2014, 20:54
Mikhail_dev
Приложение перестало запускаться после написания кода для 66 текстового поля...
Используйте две программы, одна с 65 полями, другая с 25 + 1 для вывода
... как можно упростить код?
выкинуть код =)

Почитайте про ListView и про адаптеры к ним. Я думаю упростите код на два порядка.

Re: нужно ссумировать кучу чисел...

Добавлено: 10 мар 2014, 21:07
rezak90
а по моему оригинально, идеи стоит жить... в архивах))

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 06:29
АндрЕвгений
А нельзя ли создать отдельный класс для TextWatcher и применить его ко всем полям?
Всё-таки, взгляните ещё разок на эту жесть... Мне важно, чтобы всё было на одной activity.
Заранее благодарен :)

P.S. Приложение может «загнуться» из-за слишком длинного исходного кода?

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 09:52
АндрЕвгений
Как создать класс для Текствотчера, чтобы не громоздить код?

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 10:12
adarash
rezak90 писал(а):а по моему оригинально, идеи стоит жить... в архивах))
в разделе bad practice

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 12:02
АндрЕвгений
Ха... Весёлые вы ребята :) :) :) А помочь кто-нибудь может? Я понимаю, что нагородил тама... Именно поэтому и обратился к вам, профессионалам.

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 12:19
Foenix
АндрЕвгений писал(а):Ха... Весёлые вы ребята :) :) :) А помочь кто-нибудь может? Я понимаю, что нагородил тама... Именно поэтому и обратился к вам, профессионалам.
тебе уже ответили. Сиди думай. Потом что-то делай, потом опять обращайся. А так - чего ждать?

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 12:33
adarash
АндрЕвгений писал(а):Ха... Весёлые вы ребята :) :) :) А помочь кто-нибудь может? Я понимаю, что нагородил тама... Именно поэтому и обратился к вам, профессионалам.
ListView или GridView и Adapter. Уже писали.

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 14:00
АндрЕвгений
тебе уже ответили. Сиди думай. Потом что-
то делай, потом опять обращайся. А так -
чего ждать?
Попытка — не пытка! :) Я в программировании зелёны новичёк ещё совсем... До компа только через три часа доберусь... Думал, может, кому не лень, как в прошлый раз, кусочек кода с ListView для моего случая подкинет :)

Спасибо большое за подсказку! :) буду вечером шевелить извилинами :)

Re: нужно ссумировать кучу чисел...

Добавлено: 11 мар 2014, 14:09
АндрЕвгений
АндрЕвгений писал(а):А нельзя ли создать отдельный класс для TextWatcher и применить его ко всем полям?
Это возможно?

Re: нужно ссумировать кучу чисел...

Добавлено: 18 мар 2014, 08:33
АндрЕвгений
Ребят, плиз, дайте ещё подсказочек)

Re: нужно ссумировать кучу чисел...

Добавлено: 18 мар 2014, 08:34
АндрЕвгений
Или дайте, пож, ссылку на какой-нибудь другой форум...

Re: нужно ссумировать кучу чисел...

Добавлено: 18 мар 2014, 08:35
АндрЕвгений
Я, просто нигде не видел, что это место для продвинутых программеров. Пожалуйста, покажите кусочек рабочего кода для моего случая.

Re: нужно ссумировать кучу чисел...

Добавлено: 18 мар 2014, 09:51
mdzht
АндрЕвгений писал(а):Или дайте, пож, ссылку на какой-нибудь другой форум...
ссылка на другой форум Там таких новичков очень весело встретят индусы

Re: нужно ссумировать кучу чисел...

Добавлено: 18 мар 2014, 12:07
АндрЕвгений
Спасибо, mdzht!) Похоже это то, что мне нужно!) Буду пробовать вечером)