안녕하세요.

 

로그인 Activity에서 로그인을 하면 메인 Activity가  보여지면서

 

로그인 정보를 가져오라는 이벤트 핸들과 ProgressDialog를 띄우라는 이벤트 핸들을 실행시킵니다.

 

ProgressDialog를 띄어 놓고 로그인 정보를 XML로 받고 Parsing까지 끝나면

 

ProgressDialog를 종료하라는 이벤트 핸들을 실행시키는 구조입니다.

 

이때 로그인 정보를 XML로 받고 Parsing까지 하는 작업을 Thread를 이용해서 작업을 하도록 하게 하였는데요

 

이 과정에서 ProgressDialog의 Progress가 멈춰 버립니다.

 

이때 로그인 정보로 받는 XML은 약 6천줄정도 되는 대용량 XML데이터입니다.

 

멈춰 버리는 부분은

 

HttpClient client = new DefaultHttpClient();
HttpGet method  = new HttpGet(new URI(url));
HttpResponse response = client.execute(method);

 

이 부분에서 execute() 를 실행하는 순간입니다.

 

또한 이 때 CPU사용량을 확인해보니 97%까지 올라가더라구요.

 

이 함수가 CPU할당을 그렇게 크게 사용하는 합수인가요?

 

이것때문에 메인쓰레드까지 영향을 받을 정도의 큰 것입니까?

 

아니면 다른 이유가 있는 것인지요??

 

 

전체 코드는 다음과 같습니다.

 

public boolean getHTTP_VodList(String url, VodInfo vodInfo, ArrayList<VodItemInfo> items) throws Exception
 {
  boolean result = true;
  
  String fileName = "vod_xml_data.xml";
  
  //get Web Data
  InputStream istream = null;
  
  HttpClient client = new DefaultHttpClient();

        try {
         //HttpResponse response = client.execute(httpPost);
         
         HttpGet method  = new HttpGet(new URI(url));
         HttpResponse response = client.execute(method); 
         
         HttpEntity responseResultEntity = response.getEntity();
   
   if(responseResultEntity != null){
    // get result from response
    istream = responseResultEntity.getContent();
    
    //save stream data to XML file
    if( convertStreamToFile(istream, fileName) )
    {
     Log.i("modHTTP getHTTP_VodList()", "test success save file");
     
     result = parsingVodData(fileName, vodInfo, items);
    }//end if
   }//end if
   
        }//end try
  catch (ClientProtocolException e) {
   Log.e("modHTTP getHTTP_VodList()", "Client Protocol Exception occur : " + e.getMessage());
   e.printStackTrace();
  } catch (IOException e) {
   Log.e("modHTTP getHTTP_VodList()", "IO Exception occur : " + e.getMessage());
   e.printStackTrace();
  }catch(Exception e){
   Log.e("modHTTP getHTTP_VodList()", "Exception occur : " + e.getMessage());
   e.printStackTrace();
  }//end catch

  return result;
 }//end getHTTP_VodList()

 

 

 

답변 부탁드리겠습니다.ㅠ