public class BusDetail extends Activity{
TextView busDetail;
static MyItemId idList;
ArrayList<MyItemId> items;
ArrayList<String> stNmItem;
ProgressDialog mProgress;
boolean mRaw;
TextView busName;
ArrayAdapter<String> adapter2;
ListView list;
boolean keep=false;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.busdetail);
busDetail=(TextView)findViewById(R.id.detail);
busName = (TextView)findViewById(R.id.busName);
list=(ListView)findViewById(R.id.busList);
items=new ArrayList<MyItemId>();
items.add(idList);
busDetail.setText(items.get(0).info);
busName.setText(items.get(0).name);
list.setAdapter(adapter2);
stNmItem = new ArrayList<String>();
adapter2 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,stNmItem);
ListView myList;
myList=(ListView)findViewById(R.id.busList);
myList.setAdapter(adapter2);
mProgress = ProgressDialog.show(this, "Wait", "Downloading...");
String serviceUrl="http://ws.bus.go.kr/api/rest/arrive/getArrInfoByRouteAll";
String serviceKey = "sbMXmgrMwrFsIh1NyW3VUwk4sVtG%2BZ9ybaBcqc6KLUm%2FTTe6pJyzASZIhans0HtyVJypCQp%2FzaWqASbmN7t1nw%3D%3D";
String busRouteId=items.get(0).id;
String strURL = serviceUrl+"?ServiceKey="+serviceKey+"&busRouteId="+busRouteId;
DownThread thread = new DownThread(strURL);
thread.start();
}
public static void getBusIdList(MyItemId list) {
idList=list;
}
public void onDestroy(){
super.onDestroy();
keep = false;
}
}