aqui neste local
String alert3 = "\n Nome da loja: " + nameloja.getText().toString();
String alert1 = "\n Nota da Loja: " + res;
String alert2 = "\n Produtos em falta: " ;
no ultimo gostaria de fazer aparece o nome de todos os items que não foram selecionados alguém sabe como fazer isso ?
package projetoleandro.myapplication;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.app.AlertDialog;
public class FirstActivity extends Activity {
/** Called when the activity is first created. */
CheckBox a;
CheckBox s;
CheckBox d;
CheckBox f;
CheckBox g;
CheckBox h;
CheckBox j;
CheckBox k;
CheckBox q;
CheckBox w;
CheckBox e;
CheckBox rr;
CheckBox t;
CheckBox y;
CheckBox u;
CheckBox i;
CheckBox z;
CheckBox x;
CheckBox c;
CheckBox v;
CheckBox b;
CheckBox n;
CheckBox m;
CheckBox aa;
CheckBox ss;
CheckBox dd;
CheckBox ff;
EditText nameloja;
EditText resultado;
EditText hh,jj,kk,fr,qq,ww,ee;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first);
a = (CheckBox) findViewById(R.id.a);
s = (CheckBox) findViewById(R.id.s);
d = (CheckBox) findViewById(R.id.d);
f = (CheckBox) findViewById(R.id.f);
g = (CheckBox) findViewById(R.id.g);
h = (CheckBox) findViewById(R.id.h);
j = (CheckBox) findViewById(R.id.j);
k = (CheckBox) findViewById(R.id.k);
q = (CheckBox) findViewById(R.id.q);
w = (CheckBox) findViewById(R.id.w);
e = (CheckBox) findViewById(R.id.e);
t = (CheckBox) findViewById(R.id.t);
y = (CheckBox) findViewById(R.id.y);
u = (CheckBox) findViewById(R.id.u);
i = (CheckBox) findViewById(R.id.i);
z = (CheckBox) findViewById(R.id.z);
x = (CheckBox) findViewById(R.id.x);
c = (CheckBox) findViewById(R.id.c);
v = (CheckBox) findViewById(R.id.v);
b = (CheckBox) findViewById(R.id.b);
n = (CheckBox) findViewById(R.id.n);
m = (CheckBox) findViewById(R.id.m);
rr = (CheckBox) findViewById(R.id.rr);
aa = (CheckBox) findViewById(R.id.aa);
ss = (CheckBox) findViewById(R.id.ss);
dd = (CheckBox) findViewById(R.id.dd);
ff = (CheckBox) findViewById(R.id.ff);
resultado = (EditText) findViewById(R.id.total);
hh = (EditText) findViewById(R.id.hh);
jj = (EditText) findViewById(R.id.jj);
kk = (EditText) findViewById(R.id.kk);
fr = (EditText) findViewById(R.id.fr);
qq = (EditText) findViewById(R.id.qq);
ww = (EditText) findViewById(R.id.ww);
ee = (EditText) findViewById(R.id.ee);
nameloja = (EditText) findViewById(R.id.nameloja);
Button bttotal = (Button) findViewById(R.id.btsomar);
bttotal.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
double total = 0;
if (a.isChecked()) {
total += 10.0;
}
if (s.isChecked()) {
total += 5.00;
}
if (d.isChecked()) {
total += 5.00;
}
if (f.isChecked()) {
total += 4.00;
}
if (g.isChecked()) {
total += 1.00;
}
if (h.isChecked()) {
total += 1.00;
}
if (j.isChecked()) {
total += 1.00;
}
if (k.isChecked()) {
total += 2.00;
}
if (q.isChecked()) {
total += 1.00;
}
if (w.isChecked()) {
total += 2.00;
}
if (e.isChecked()) {
total += 2.00;
}
if (rr.isChecked()) {
total += 1.00;
}
if (t.isChecked()) {
total += 3.50;
}
if (y.isChecked()) {
total += 3.50;
}
if (u.isChecked()) {
total += 1.00;
}
if (z.isChecked()) {
total += 4.50;
}
if (x.isChecked()) {
total += 6.00;
}
if (c.isChecked()) {
total += 4.50;
}
if (v.isChecked()) {
total += 1.00;
}
if (b.isChecked()) {
total += 1.00;
}
if (z.isChecked()) {
total += 4.50;
}
if (n.isChecked()) {
total += 6.00;
}
if (m.isChecked()) {
total += 4.00;
}
if (aa.isChecked()) {
total += 1.50;
}
if (ss.isChecked()) {
total += 2.00;
}
if (dd.isChecked()) {
total += 2.50;
}
if (ff.isChecked()) {
total += 2.00;
}
double num1 = Double.parseDouble(hh.getText().toString());
double num2 = Double.parseDouble(jj.getText().toString());
double num3 = Double.parseDouble(kk.getText().toString());
double num4 = Double.parseDouble(qq.getText().toString());
double num5 = Double.parseDouble(ww.getText().toString());
double num6 = Double.parseDouble(ee.getText().toString());
double num7 = Double.parseDouble(fr.getText().toString());
String res = String.valueOf(num1+num2+num3+num4+num5+num6+num7+total);
String alert3 = "\n Nome da loja: " + nameloja.getText().toString();
String alert1 = "\n Nota da Loja: " + res;
String alert2 = "\n Produtos em falta: " ;
////
// Instância
AlertDialog.Builder dialogo = new AlertDialog.Builder(FirstActivity.this);
// setando título
dialogo.setTitle("Resultado");
// setando mensagem
// setando mensagem
dialogo.setMessage(alert3 + alert1+alert2);
// setando botão
dialogo.setNeutralButton("OK", null);
// chamando o AlertDialog
dialogo.show();
}
});
}
}