원래는 가져온 텍스트와 이미지의 순서가 맞았느데

이미지는 따로 thread를 돌려 받아오게 하였더니 순서가 틀려지는데

왜그런지 알고 싶습니다

어차피 tv2.setImageBitmap(getRemoteImage(url));// 이미지를 등록해야할부분

에들어가는 url을 위에서 만들어 저기에 넣어주는거라 똑같아야할것 같은데

잘안되네요 답변 부탁드리겠습니다

public class XmlParser extends ListActivity {
 private int listNumber = 10;
 private ArrayList<XmlData> m_xmlData;
 private String m_sConnectUrl;
 private String sTag;
 private XmlData xmlData = null;
 private XmlListAdapter adapter;
 private ListView listView;
 private TextView tv1;
 private EditText et;
 private boolean popAlert=false;
 private Thread t1;
 private Thread t2;
 private ImageView tv2;
 
 private URL url = null; 
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  listNumber = 10;
  xmlData = new XmlData();
  Button searchBtn = (Button) findViewById(R.id.searchBtn);
  et = (EditText) findViewById(R.id.searchTxt);
  tv1 = (TextView) findViewById(R.id.title);
  listView = (ListView) this.getListView();
  listView.setOnScrollListener(new OnScrollListener() {
   public void onScrollStateChanged(AbsListView view, int scrollState) {
    // TODO Auto-generated method stub
   }
   public void onScroll(AbsListView view, int firstVisibleItem,
     int visibleItemCount, int totalItemCount) {
    System.out.println("f : " + firstVisibleItem + " vc : "
      + visibleItemCount + " tc : " + totalItemCount);
    if ((firstVisibleItem + visibleItemCount) == totalItemCount) {
     listNumber += 10;
     listAdd();
    }
   }
  });
  // 버튼 클릭시 xml을 읽기위한 함수 호출
  searchBtn.setOnClickListener(new View.OnClickListener() {
  public void onClick(View v) {
    final String searhTxt = et.getText().toString();
    
    if (searhTxt == "") {
    } else {
     new GrabURL(searhTxt).execute(searhTxt);
    }
   }
  });
 }
// XmlPullParser를 이용 xml을 읽는다.
 public ArrayList<XmlData> searchXml(String searchTxt) {
  String m_searchTxt = "";
  try {
   
   // m_searchTxt = URLEncoder.encode(searchTxt,"EUC-KR");
   m_searchTxt = URLEncoder.encode(searchTxt);
   
  } catch (Exception e1) {
   e1.printStackTrace();
  }
  // String m_sConnectUrl =
  // "http://newssearch.naver.com/search.naver?where=rss&query="+m_searchTxt+"&st=news.all&q_enc=EUC-KR&r_enc=UTF-8&r_format=xml&rp=none&sm=all.basic&ic=all&so=rel.dsc&detail=0&pd=1&start=1&display=20";
  m_sConnectUrl = "http://openapi.naver.com/search?key=29b0a07ddfe7502eb2d0c585cd448a32&query="
    + m_searchTxt + "&target=image&start=1&display=" + listNumber;
  
  m_xmlData = new ArrayList<XmlData>();
  try {
   XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
   factory.setNamespaceAware(true);
   XmlPullParser xpp = factory.newPullParser();
   URL u = new URL(m_sConnectUrl);
   // InputStream in = u.openConnection().getInputStream();
   InputStream in = u.openStream();
   xpp.setInput(in, "utf-8");
   int eventType = xpp.getEventType();
   while (eventType != XmlPullParser.END_DOCUMENT) {
    if (eventType == XmlPullParser.START_DOCUMENT) {
    } 
    else if (eventType == XmlPullParser.END_DOCUMENT) {
     
    } 
    else if (eventType == XmlPullParser.START_TAG) {
     sTag = xpp.getName();
     if (sTag.equals("title")) {
      
      xmlData.d_title = xpp.nextText();
     }
     if (sTag.equals("link")) {
      xmlData.d_link = xpp.nextText();
     }
     if (sTag.equals("thumbnail")) {
      xmlData.d_thumbnail = xpp.nextText();
     }
    } else if (eventType == XmlPullParser.END_TAG) {
     sTag = xpp.getName();
     if (sTag.equals("item")) {
      m_xmlData.add(xmlData);
      xmlData = null;
     }
    } else if (eventType == XmlPullParser.TEXT) {
    }
    eventType = xpp.next();
   }
  } catch (Exception e) {
   
  }
  return m_xmlData;
 }
 public void listAdd() {
  try {
   XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
   factory.setNamespaceAware(true);
   XmlPullParser xpp = factory.newPullParser();
   URL u = new URL(m_sConnectUrl);
   // InputStream in = u.openConnection().getInputStream();
   InputStream in = u.openStream();
   xpp.setInput(in, "utf-8");
   int eventType = xpp.getEventType();
   while (eventType != XmlPullParser.END_DOCUMENT) {
    if (eventType == XmlPullParser.START_DOCUMENT) {
     // System.out.println("Start document");
    } else if (eventType == XmlPullParser.END_DOCUMENT) {
     // System.out.println("End document");
    } else if (eventType == XmlPullParser.START_TAG) {
     // Log.e("START_TAG",xpp.getName());
     sTag = xpp.getName();
     if (sTag.equals("title")) {
      xmlData = new XmlData();
      xmlData.d_title = xpp.nextText();
     }
     if (sTag.equals("link")) {
      xmlData.d_link = xpp.nextText();
     }
     if (sTag.equals("thumbnail")) {
      xmlData.d_thumbnail = xpp.nextText();
     }
    } else if (eventType == XmlPullParser.END_TAG) {
     sTag = xpp.getName();
     if (sTag.equals("item")) {
      m_xmlData.add(xmlData);
      xmlData = null;
     }
    } else if (eventType == XmlPullParser.TEXT) {
    }
    eventType = xpp.next();
   }
   adapter.notifyDataSetChanged();
  } catch (Exception e) {
   // TODO: handle exception
  }
 }
 // List의 row를 변형하기 위해 Adapter 오버라이딩
 private class XmlListAdapter extends ArrayAdapter {
  private ArrayList items;
  public XmlListAdapter(Context context, int textViewResourceId,
    ArrayList items) {
   super(context, textViewResourceId, items);
   this.items = items;
  }
  public View getView(int position, View convertView, ViewGroup parent) {
   View v = convertView;
   
   if (v == null) {
    LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    v = vi.inflate(R.layout.row, null);
   }
   final XmlData xmlData = (XmlData) items.get(position);
   if (xmlData != null) {
    tv1 = (TextView) v.findViewById(R.id.title);
    tv2 = (ImageView) v.findViewById(R.id.thumb);
    if (tv1 != null) {
     // tv1.setText(xmlData.d_title);
     tv1.setText(Html.fromHtml("<a href='" + xmlData.d_link
       + "'>" + xmlData.d_title + "</a>"));
     tv1.setMovementMethod(LinkMovementMethod.getInstance());
    }
//    if (tv2 != null) {
//     new Thread(new Runnable()
//     {
//      public void run()
//      {
//       System.out.println("==============================");
//       Message msg = myHandler.obtainMessage();
//       msg.what = -1;
//       System.out.println("msg : "+msg );
//       myHandler.sendMessage( msg );
//       
//      }
//     }
//     ).start(); 
//    }
    
    if (tv2 != null) {
     
     try {
      url = new URL(xmlData.d_thumbnail);
     } catch (MalformedURLException e) {
      e.printStackTrace();
     }
//     tv2.setImageBitmap(null);
     new Thread(new Runnable()
     {
      public void run()
      {
       System.out.println("==============================");
       Message msg = myHandler.obtainMessage();
       msg.what = -1;
       System.out.println("msg : "+msg );
       myHandler.sendMessage(msg);
       
      }
     }
     ).start(); 
//     tv2.setImageBitmap(getRemoteImage(url));// 이미지를 등록해야할부분
    }
   }
   return v;
  }
  Handler myHandler = new Handler()
  {
   public void handleMessage( Message msg )
   {
    if ( msg.what == -1 )
    {
     System.out.println("tv2 : "+tv2);
     tv2.setImageBitmap(getRemoteImage(url));// 이미지를 등록해야할부분
//     Toast.makeText(XmlParser.this, "Finish Thread!!!", Toast.LENGTH_SHORT).show();
    }
    else if ( msg.what == -100 )
    {
     
     
    }
    else
    {
    }
   }
  };
 }
 public Bitmap getRemoteImage(final URL aURL) {
  try {
   final URLConnection conn = aURL.openConnection();
   conn.connect();
   final BufferedInputStream bis = new BufferedInputStream(conn
     .getInputStream());
   final Bitmap bm = BitmapFactory.decodeStream(bis);
  bis.close();
   return bm;
} catch (IOException e) {
   Log.d("DEBUGTAG", "Oh noooz an error...");
  }
  return null;
 }
 
 private class GrabURL extends AsyncTask<String, Void, Void>{
//  private final HttpClient Client = new DefaultHttpClient();
  private String Content;
  private String Error = null;
  private ProgressDialog Dialog =  new ProgressDialog(XmlParser.this);
  private String searhTxt =""; 
  
  private GrabURL(String _searhTxt){
   this.searhTxt = _searhTxt;
  }
  
  /**
   * 작업이 시작되기 직전에 화면에 처리해야할 작업
   */
  protected void onPreExecute() {
   super.onPreExecute();
   Dialog.setMessage("로딩중");
   Dialog.show();
  }
  /**
   * 백그라운드에서 처리해야할 내용
   */
  @Override
  protected Void doInBackground(String... params) {
   try{
//    HttpGet httpget = new HttpGet();
//    ResponseHandler <String> resposeHandler = new BasicResponseHandler();
//    Content = Client.execute(httpget , resposeHandler);
    searchXml(searhTxt);
    
   }catch(Exception e){
    Error = e.getMessage();
    cancel(true);
   }
   return null;
  }
  /**
   * 백그라운드 작업이 종료된 직후 화면에 처리해야 할 작업
   */
  @Override
  protected void onPostExecute(Void result) {
   // TODO Auto-generated method stub
   super.onPostExecute(result);
   System.out.println("m_xmlData : "+m_xmlData);
   adapter = new XmlListAdapter(XmlParser.this, R.layout.row, m_xmlData);
   setListAdapter(adapter);
   Dialog.dismiss();
//   searchXml(searhTxt);
//   if(Error != null){
//    Toast.makeText(XmlParser.this, Error, Toast.LENGTH_LONG).show();
//   }else{
//    Toast.makeText(XmlParser.this, "Source : "+Content , Toast.LENGTH_LONG).show();
//   }
  }
 }
}