package c.ms;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class LogtestActivity extends Activity {
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState) ;
  TextView textView = new TextView(this) ;
  textView.setText("Parse xml ..") ;
  setContentView(textView) ;
  
  try {
   URL text = new URL(" "주소" ) ;
   
   XmlPullParserFactory parserCreator = XmlPullParserFactory.newInstance() ;
   XmlPullParser parser = parserCreator.newPullParser() ;
   
   parser.setInput(text.openStream(), null) ;
   
   textView.setText("Parsing ..") ;
   int parserEvent = parser.getEventType() ;
   String tag ;
   // boolean inTitle = false ;
   
   List<Employee> employees = null ;
   Employee employee = null ;
   boolean done = false ;
   
   while(parserEvent != XmlPullParser.END_DOCUMENT && !done){
    switch(parserEvent) {
     case XmlPullParser.START_DOCUMENT :
      employees = new ArrayList<Employee>() ;
      break ;
     case XmlPullParser.END_TAG:
      tag = parser.getName();
      if(tag.equalsIgnoreCase("company") && employee != null) {
       Log.i("dd","--------------------------------") ;
       employees.add(employee) ;
      }
      
      else if(tag.equalsIgnoreCase("root")) {
       done = true ;
       Log.i("dd","" ) ;
      }
      break ;
     case XmlPullParser.START_TAG :
      tag = parser.getName();
      // -- department
      if(tag.equalsIgnoreCase("root")){
       Log.i("dd","" ) ;
      }
      // -- employee
      else if(tag.equalsIgnoreCase("company")){
       Log.i("dd","--------------------------------") ;
       employee = new Employee() ;
      }
      else if(tag.equalsIgnoreCase("s_date")) {
       Log.i("dd","s_date:"+parser.nextText() ) ;
       employee.setS_date(tag) ;
      }
      else if(tag.equalsIgnoreCase("comm_u")) {
       Log.i("dd","comm_u:"+parser.nextText() ) ;
       employee.setComm_u(tag) ;
      }
      
      break ;
    }
    parserEvent = parser.next();
   }
   Log.i("dd","Employee Count:"+employees.size()) ;
   textView.setText("");
   for(Employee item : employees){
   textView.append("NAME : " + item.getComm_u());
   textView.append(", CODE : " + item.getS_date() + "\n");
   }
   
  } catch (MalformedURLException e) {
   e.printStackTrace();
  } catch (XmlPullParserException e) {
   e.printStackTrace();
  } catch (IOException e) {
   e.printStackTrace();
  }
 }
 
 public class Employee implements Comparable<Employee> {
  private String S_date ;
  private String Comm_u ;
  
  public void setS_date ( String S_date ) {
   this.S_date = S_date ;
  }
  
  public void setComm_u( String comm_u ) {
   this.Comm_u = comm_u ;
  }
  
  public String getS_date() {
   return S_date ;
  }
  
  public String getComm_u() {
   return Comm_u ;
  } 
  
  public int compareTo(Employee another) {
   if(another == null) return 1 ;
   // -- sort ascending
   return another.Comm_u.compareTo(Comm_u);
  }
 }
}

xml 파싱 후 출력되도록 소스를 수정했지만
logcat에서만 나오고 정작 어플리케이션을 실행하면 그냥 검은화면만 뜨네요ㅠㅠ
xml 파싱한 내용들을 제대로 어플리케이션 화면에 뿌리려면 어떻게 해야하나요?ㅠㅠ