A lo cual propuse:
Código:
Pero... aún se sigue generando la misma excepción.final Runnable request_execute = new Runnable(){ @Override public void run() { // TODO Auto-generated method stub try { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet("http://maps.googleapis.com/maps/api/geocode/json?address=Bucaramanga&sensor=false"); HttpResponse response = client.execute(request); Toast toast = Toast.makeText(getApplicationContext(), R.string.app_name, Toast.LENGTH_SHORT); toast.show(); } catch(Exception e) { Toast toast = Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT); toast.show(); } }}; public void myThread() { Thread thread = new Thread(){ public void run() { handler.post(request_execute); } }; thread.start(); } public void toSearch(View view) { this.myThread(); }
¿Alguna opinión? Desde ya muchas gracias.