Muy buenas… queria agradecerles por la ayuda q me dieron…
Tengo otro problema necesito listar notas y materias esta es mi clase de la cual llamo
public class Listarnotasss extends Activity {
private String res;
private ProgressDialog pd;
private ListView lista;
private Context context;
private ListView lstClientes;
private TextView txtResultado;
private String CII;
//NotaEstudiantes[] notasEstudiante;
//consultaUsuario[] notasEstudiante;
Notas [] listaFinal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);context=this;
setContentView(R.layout.activity_listarnotasss);
Intent intent;
CII = getIntent().getStringExtra(“ciii”);
new DownloadTask1().execute(“”);
pd = ProgressDialog.show(context, “Cargando”,”notas”, true, false);
}
private class DownloadTask1 extends AsyncTask<String, Void, Object>
{
protected Integer doInBackground(String… args) {
Cardatos ws = new Cardatos();
listaFinal=ws.listarn(CII);
return 1;
}
protected void onPostExecute(Object result) {
pd.dismiss();
//DecimalFormatSymbols simbolos = new DecimalFormatSymbols();
//simbolos.setDecimalSeparator(‘,’);
DecimalFormat nume = new DecimalFormat(“00.00″);
ArrayList<Lista_entrada11> datos = new ArrayList<Lista_entrada11>();
String c=””;String r=”Sin respuesta”;Double num;
final int[] datos1 = new int[listaFinal.length];
final String[] datos2 = new String[listaFinal.length];
final String[] datos3 = new String[listaFinal.length];
for(int i=0; i<listaFinal.length; i++)
{
datos1[i] = listaFinal[i].id;
datos2[i] = listaFinal[i].material;
datos3[i] = listaFinal[i].notafinal;
c=datos3[i];
c=c.replace(‘,’, ‘.’);
num=Double.parseDouble(c);
String nota=nume.format(num);
datos.add(new Lista_entrada11(datos1[i],datos2[i],nota));
}
lista = (ListView) findViewById(R.id.ListView_listado);
lista.setAdapter(new Lista_adaptador11(Listarnotasss.this, R.layout.entrada2, datos){
Double n;
@Override
public void onEntrada(Object entrada, View view) {
if (entrada != null) {
TextView texto_der = (TextView) view.findViewById(R.id.textViewmateria);
if (texto_der != null)
n=Double.valueOf(((Lista_entrada11) entrada).get_notafinal());
if(n>=50.5)
{texto_der.setTextColor(Color.BLUE);}
else
{texto_der.setTextColor(Color.RED);}
texto_der.setText(((Lista_entrada11) entrada).get_material());
TextView texto_izq = (TextView) view.findViewById(R.id.textViewNOTAFINAL);
if (texto_izq != null)
n=Double.valueOf(((Lista_entrada11) entrada).get_notafinal());
if(n>=50.5)
{texto_izq.setTextColor(Color.BLUE);}
else
{texto_izq.setTextColor(Color.RED);}
texto_izq.setText(((Lista_entrada11) entrada).get_notafinal());
}
}
});
lista.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> pariente, View view, int posicion, long id) {
Lista_entrada11 elegido = (Lista_entrada11) pariente.getItemAtPosition(posicion);
}
});
}
}
}
——————————————————————————————–
ahora esta es la clase de la cual le llamo
private Notas[] listarNOTA;
public Notas[] listarn(String ci)
{
String res=null;
SoapObject rpc;
rpc = new SoapObject(“XXXXXXXXXXX/”, “XXXXXXXXX”);
rpc.addProperty(“ci”, ci);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
HttpTransportSE androidHttpTransport= null;
try {
String conexion = “http://XXXXXXXXXXXXXXXXXXXXXXXXXX”;
androidHttpTransport = new HttpTransportSE(conexion);
androidHttpTransport.debug = true;
androidHttpTransport.call(“http://XXXXXXXXXXXXXXXXXXXXXX”, envelope);
SoapObject resSoap =(SoapObject)envelope.getResponse();
listarNOTA = new Notas[resSoap.getPropertyCount()];
for (int i = 0; i < listarNOTA.length; i++)
{
SoapObject ic = (SoapObject)resSoap.getProperty(i);
Notas lis = new Notas();
lis.id=Integer.parseInt(ic.getPropertyAsString(“id”).toString());
lis.material=ic.getPropertyAsString(“material”).toString();
lis.notafinal=ic.getPropertyAsString(“notafinal”).toString();
listarNOTA[i] = lis;
}
}catch (Exception e){
System.out.println(e.getMessage());
res=e.getMessage();
}
return listarNOTA;
}
————————————————————
corre perfecto en mi computadora lo lista… la cosa es cuando le instalo en mi celular y no me corre me dice que se ha detenido…
y trabajo con el getPropertyAsString por que con el getProperty no me sale