Où “quitter” avec un looper?

J'ai un problème avec un looper. J'appelle looper.prepare(), et après avoir fait quelque chose que tout fonctionne bien. Mais si j'ai faites pivoter l'appareil, j'obtiens une exception sur le préparer.

07-12 16:40:09.760: E/activity(15809):  java.lang.RuntimeException: Only one Looper may be created per thread

Je suis en train de quitter le looper, mais il ne fait rien.

Voici mon AsyncTask:

 @Override
protected String doInBackground(String... args) {
try{Looper.prepare();   //here start the exception
try {  
URL  url = new URL(link); 
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
conn.setDoInput(true);   
conn.connect();  
InputStream is = conn.getInputStream();
utente.measure(0, 0);
bmImg = decodeSampledBitmapFromResource(is,(int) utente.getMeasuredWidth(), utente.getMeasuredHeight(), link);
if(bmImg!=null){
try{  
getCroppedBitmap();
}catch(Exception e){
System.out.println(e);
}
}
}
catch (IOException e)
{       
Log.e("lele", "errore qui");
e.printStackTrace();  
}
Looper.myLooper().quit();   //do nothings
}catch(Exception e){
Log.e("canta tu",  " "+e);
}
Looper.myLooper().quit();  //do nothings
return null;   
}
@Override       
protected void onPostExecute(String args) {
//Looper.myLooper().quit();   //generathed an error, main thread can't stop looper
if(bmImg!=null){ 
try{
utente.setImageBitmap(bmImg);
ellisse.setVisibility(View.VISIBLE);
}catch(Exception e){
Log.e("lele",""+e);
Log.e("lele","errore probabile out of bound");
}
}
else {
Toast.makeText(getApplicationContext(), "Modifica la foto da \"profilo\"", Toast.LENGTH_LONG).show();
}

Idées?

InformationsquelleAutor Lele | 2013-07-12