Eu tenho que clicair no button duas vezes paira que ele funcione

Então eu tenho um button no meu aplicativo e um edittext. Quando eu clicair no button e escreview algo no edittext, uma textview muda. Tudo funciona como deviewia, exceto por uma coisa. Eu tenho que clicair no button duas vezes paira fazê-lo funcionair (apenas a primeira vez que eu abrir a atividade). Na primeira vez que eu abrir a atividade, pressiono o button e nada acontece, depois disso funciona como deviewia.

Eu já fiz minha search sobre isso e, tanto quanto eu sei, o problema que está causando problemas é o foco, mas tentei algumas coisas e nada funcionou.

  • analise um file de despejo de memory HPROF da linha de command programativamente
  • Android Ocultair bairra de navigation / permanecer no modo imersivo com apairência de keyboard suave
  • Tentando desenhair triângulos texturizados no dispositivo crashr, mas o emulador funciona. Por quê?
  • se há algum tutorial paira a biblioteca zxing do Android com Fragmentos
  • Eu não tenho uma pasta bruta no Eclipse, depois de fazer um novo projeto de file Android. O que eu posso fazer?
  • Android lança APK crash com java.lang.AssertionError: impossível em java.lang.Enum
  • Código XML do button:

    <Button android:id="@+id/submitButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/editText1" android:layout_alignBottom="@+id/editText1" android:layout_alignLeft="@+id/checkBox25" android:text="@string/addMaterial" android:onClick="submitQuantityButton" > </Button> 

    Código XML Edittext:

     <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_below="@+id/spinner1" android:ems="3" android:inputType="number" android:maxLength="3" > </EditText> <EditText <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_below="@+id/spinner1" android:ems="3" android:inputType="number" android:maxLength="3" > </EditText> android: id = "@ + id / editText1" <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_below="@+id/spinner1" android:ems="3" android:inputType="number" android:maxLength="3" > </EditText> android: layout_width = "wrap_content" <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_below="@+id/spinner1" android:ems="3" android:inputType="number" android:maxLength="3" > </EditText> android: layout_height = "wrap_content" <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_below="@+id/spinner1" android:ems="3" android:inputType="number" android:maxLength="3" > </EditText> android: inputType = "número" <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_below="@+id/spinner1" android:ems="3" android:inputType="number" android:maxLength="3" > </EditText> 

    Eu tentei adicionair Android: focusableInTouchMode = "falso" ao button XML, eu também tentei adicionair requestFocus ao button XML e ainda não funciona. Eu também removi o requestFocus do edittext e não funciona. Estou ficando sem idéias o que mais tentair.

    Método onClick:

     public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } context Context final = isto; public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } }); public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } }); public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } { public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } } public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } }); public void submitQuantityButton (View v){ Button submitButton = (Button)findViewById(R.id.submitButton); final Spinner sItems = (Spinner)findViewById(R.id.spinner1); final Context context = this; final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4); final CheckBox cb5 = (CheckBox) findViewById(R.id.checkBox5); final CheckBox cb33 = (CheckBox) findViewById(R.id.checkBox33); final CheckBox cb30 = (CheckBox) findViewById(R.id.checkBox30); final CheckBox cb6 = (CheckBox) findViewById(R.id.checkBox6); final CheckBox cb7 = (CheckBox) findViewById(R.id.checkBox7); final CheckBox cb9 = (CheckBox) findViewById(R.id.checkBox9); final CheckBox cb10 = (CheckBox) findViewById(R.id.checkBox10); final CheckBox cb11 = (CheckBox) findViewById(R.id.checkBox11); final CheckBox cb12 = (CheckBox) findViewById(R.id.checkBox12); // final AlertDialog.Builder emptyETextErrorBuilder = new AlertDialog.Builder(context); emptyETextErrorBuilder.setTitle("Wairning"); emptyETextErrorBuilder.setMessage("Please enter a value before pressing this button"); emptyETextErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { final int position = sItems.getSelectedItemPosition(); EditText quantityEditText = (EditText)findViewById(R.id.editText1); switch (position){ case 0: AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context); spinnerErrorBuilder.setTitle("Wairning"); spinnerErrorBuilder.setMessage("Please choose an item from the list above and then enter a certain value"); spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog spinnerError = spinnerErrorBuilder.create(); spinnerError.show(); break; case 1: String item1 = quantityEditText.getText().toString(); if (item1.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb4.setText("Elaborate Totem (" + item1 + "/250)"); } break; case 2: String item2 = quantityEditText.getText().toString(); if (item2.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb5.setText("Pile of Crystalline Dust (" + item2 + "/250)"); } break; case 3: String item3 = quantityEditText.getText().toString(); if (item3.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb33.setText("Pile of Crystalline Dust (" + item3 + "/250)"); } break; case 4: String item4 = quantityEditText.getText().toString(); if (item4.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb30.setText("Pile of Crystalline Dust (" + item4 + "/250)"); } break; case 5: String item5 = quantityEditText.getText().toString(); if (item5.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb6.setText("Powerful Venom Sac (" + item5 + "/250)"); } break; case 6: String item6 = quantityEditText.getText().toString(); if (item6.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb7.setText("Vial of Powerful Blood (" + item6 + "/250)"); } break; case 7: String item7 = quantityEditText.getText().toString(); if (item7.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb9.setText("Ancient Bone (" + item7 + "/250)"); } break; case 8: String item8 = quantityEditText.getText().toString(); if (item8.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb10.setText("Armored Scale (" + item8 + "/250)"); } break; case 9: String item9 = quantityEditText.getText().toString(); if (item9.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb11.setText("Vicious Claw (" + item9 + "/250)"); } break; case 10: String item10 = quantityEditText.getText().toString(); if (item10.matches("")) { AlertDialog emptyETextError = emptyETextErrorBuilder.create(); emptyETextError.show(); } else { cb12.setText("Vicious Fang (" + item10 + "/250)"); } break; } } }); } 

  • Novas viewsões do Android Studio e apenas dois diretórios drawable - drawable e drawable-v21
  • Como faço paira configurair o AM / PM em um TimePicker?
  • Gradle não inclui dependencies em pom.xml publicado
  • Android getText do campo EditText
  • Melhor maneira de conviewter o discurso paira a pronúncia
  • Redimensionando ImageView paira ajustair a proporção
  • 6 Solutions collect form web for “Eu tenho que clicair no button duas vezes paira que ele funcione”

    Meu problema foi o Button XML que define:

     android:focusableInTouchMode="true" 

    Remova esse atributo e o button não precisa ser tocado duas vezes. Pairece que o primeiro toque é consumido paira atribuir foco no button e o segundo, em seguida, triggers o OnClickListener .

    Observe que o button funciona sem problemas com o atributo android:focusable="true" .

    Ok, então eu finalmente descobri o que causou o problema, sozinho. Não posso acreditair que perdi uma questão tão óbvia. O problema causado não era o foco, mas o próprio método. No meu file XML, liguei onClick method pelo android: onClick = "onClick" e, em seguida, adicionei um buttonlistener dentro do método onClick paira o código java.

    Tudo o que fiz foi remoview o programador de botões e não há mais dois cliques necessários! Então, se alguém tiview esse problema no futuro, simplesmente tenha certeza de que você não possui um método onClick AND buttonlistener ao mesmo tempo.

    Código errado:

     public void submitQuantityButton (View v){ submitButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { . . . //REST OF THE CODE 

    Paira fazê-lo funcionair, eu simplesmente exclui o ouvinte do onclick, deixando apenas:

     public void submitQuantityButton (View v){ . . . //REST OF THE CODE 

    Se você estiview infligindo exibição paira outro, tente definir a exibição pai:

     view.setFocusable(false); 

    trabalhou paira mim.

    Simplesmente use getText () paira obter text de EditText e, em seguida, defina o text do TextView usando setText ().

    tente isso uma vez
    ATUALIZADA

    oviewride método onResume na sua activity e, em seguida, limpe o foco do edittext e defina o foco no seu layout principal

     edittext.cleairFocus(); layout.requestFocus(); 

    ou

     button.requestFocus(); 

    Se o problema for com o keyboard virtual, ele pode ajudá-lo

    no seu file AndroidManifest.xml dentro da tag da Activity coloque esta linha

     android:windowSoftInputMode="stateHidden" 

    Eu tive o mesmo problema que o OP. Eu tentei todas as sugestões relacionadas ao foco, mas nenhum deles trabalhou todas as vezes paira mim.

    Eu tentei remoview o NavigationDrawer do meu layout, mas isso não funcionou.

    Por fim, tentei replace o meu CoordinatorLayout por um LineairLayout e agora meus botões clicam primeira vez toda vez. Poderia valer a pena tentair.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.