2013-04-19 4 views
-3

이 웹 사이트에서 가져온 여러 링크를 어떻게 반환합니까? 루프 밖에서 얻은 수익은 효과가없는 것 같습니다.doInBackground에서 여러 값 반환

public class jsoupexample extends AsyncTask<String,Integer,String>{ 
    @Override 
    protected String doInBackground(String... html) { 
     try { 
      doc = Jsoup.connect(html[0]).get(); 
     } catch (IOException e) { 
      e.printStackTrace(); 
     } 
     Elements link = doc.select("a[href]"); 

     for(Element links : link) { 
      audi=links.attr("abs:href"); 
     } 
     return audi; 
    } 

    @Override 
    protected void onPostExecute(String result) { 
     super.onPostExecute(result); 
     tv2.setText(result); 
    } 

} 

답변

0

사용이

그냥 추가 시도 플러스 기호는 모든 값을 얻을 목록 또는 문자열 배열 개체를 수집하기 위해 시도해야이

for(Element links : link) { 
      audi+=links.attr("abs:href"); 
     } 
+0

나는 이것을 시도 할 것이다! thnxx! –