10. @Override
public boolean
onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items
to the action bar if it is present.
getMenuInflater().inflate(R.menu.ma
in, menu);
return true;
}
public void operar(View view) {
EditText et1=(EditText)findViewById(R.id.et1);
EditText et2=(EditText)findViewById(R.id.et2);
TextView
tv3=(TextView)findViewById(R.id.tv3);
11. if (selec.equals("sumar")) {
int suma=nro1+nro2;
String resu=String.valueOf(suma);
tv3.setText(resu);
}
else
if (selec.equals("restar")) {
int resta=nro1-nro2;
String resu=String.valueOf(resta);
tv3.setText(resu);
}
else
if (selec.equals("multiplicar")) {
int multi=nro1*nro2;
String resu=String.valueOf(multi);
tv3.setText(resu);
}
else
if (selec.equals("dividir")) {
int divi=nro1/nro2;
String resu=String.valueOf(divi);
tv3.setText(resu);
}
}
}
12. DE ESTA FORMA SE MOSTRARA
,SI HUBIERA ERRORES DEBEMOS
SOLUCIONARLOS
14. MI CONCLUSION ESQUE EN ESTE
PROGRAMA VIMOS ALGO NUEVO PUES
LO QUE ES SPINNER ES ALGO MAS
DIFERENTE ALOS DEMAS PUES ESTE
NO NECESITA QUE LO CONFIGUREMOS
COMO LOS BUTTON Y LOS TEXVIEW SE
ME HISO INTERESANTE MUY BUENO ME
GUSTO