xml읽어서 intent로 Axtivity 연결하는 소스를 짰습니다.
if (position == 0) {
Intent intent0 = new Intent(Bus8101.this, Jungtime.class);
intent0.putExtra("name", 90000201);
intent0.putExtra("a", 54838);
intent0.putExtra("b", 1);
startActivity(intent0);
}
else if (position == 1) {
Intent intent1 = new Intent(Bus8101.this, Jungtime.class);
intent1.putExtra("name", 90000201);
intent1.putExtra("a", 57536);
intent1.putExtra("b", 2);
startActivity(intent1);
}
else if (position == 2) {
Intent intent2 = new Intent(Bus8101.this, Jungtime.class);
intent2.putExtra("name", 90000201);
intent2.putExtra("a", 54988);
intent2.putExtra("b", 3);
startActivity(intent2);
}
이렇게 넘겨서
try{
URL url = new URL("http://ws.bus.go.kr/api/rest/arrive/getArrInfoByRoute?" +
"ServiceKey===" +
"&stId=" +a+ "&busRouteId="+name + "&ord=" +b);
이렇게 받도록 짰는데
이렇게 하다보니까
intent0.putExtra("name", 90000201);
intent0.putExtra("a", 54838);
intent0.putExtra("b", 1);
여기부분을 계속해서 막노동으로 작성해야하는 수고가있어서
xml 보시면


이런식으로 항목이 쭉 뜨는데
직접 54838을 입력하는게 아니라 stId자체를 받아와서 입력시키고싶은데
어떤식으로 짜야할까요..