1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
public void onItemSelected(AdapterView<?> arg0, View v, int arg2,
long arg3) {
myProgressDialog = ProgressDialog.show(ProgressBarAppli.this,
"Please wait...", "Doing Extreme Calculations...", true);
new Thread() {
public void run() {
try{
ville=(TextView)findViewById(R.id.ville);
population=(TextView)findViewById(R.id.population);
longtitude=(TextView)findViewById(R.id.longtitude);
latitude=(TextView)findViewById(R.id.latitude);
Spinner AccCurr = (Spinner) findViewById(R.id.spinner);
sAccCurr = AccCurr.getSelectedItem().toString();
chaine=getHttpResponse(sAccCurr);
String[] result=splitResult(chaine);
ville.setText(sAccCurr);
population.setText(result[1]);
longtitude.setText(result[2]);
latitude.setText(result[3]);
sleep(5000);
} catch (Exception e) { }
// Dismiss the Dialog
myProgressDialog.dismiss();
}
}.start();
Log.i("end", "end");
} |
Partager