안녕하세요 간단한 학과검색후 학과 정보를 보여주는


어플리케이션을 만드는 도중에 검색을 해봐도 도저히 해결이 안나 이렇게 질문을 드립니다 ㅠ


해결책인 글을 봤어도 제 소스와 달라 이해가 안되더군요...


해서 이렇게 여쭙고자 왔습니다...


우선 질문을 말씀드리자면 



list를 추가 한뒤에 해당 리스트를 선택 할경우 intent를 이용하여 다른 엑티비티로 넘어가는데...

AutoCompleteTextView 이용하여 검색을 할경우 항상 첫번째 액티비티로만 넘어갑니다...

일단 소스를 보여드릴게요 ㅠ



----------------------------------------------------------------------------

public class DepList extends ListActivity {

ArrayList<String> department= new ArrayList<String>();


protected void onCreate(Bundle savedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.deplist);

department = new ArrayList<String>();


department.add("글로벌리더쉽자율전공"); 

department.add("국제경영학부");

department.add("글로벌서비스경영학부");

department.add("Glbal Dual Degree학부");

department.add("IT경영학부");


AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit); 

ArrayAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, department);

textView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, department));

textView.setAdapter(adapter); textView.setDropDownHeight(0); setListAdapter(adapter);


public void onListItemClick(ListView list, View view, int posion, long id) {


if(department.get(posion) =="글로벌리더쉽자율전공") {

Intent intent = new Intent(DepList.this, GLOBAL.class);

startActivity(intent);

}


else if(department.get(posion) =="국제경영학부") {

Intent intent = new Intent(DepList.this, IBD.class);

startActivity(intent);

}

else if(department.get(posion) =="글로벌서비스경영학부") {

Intent intent = new Intent(DepList.this, SERVICE.class);

startActivity(intent);

}

else if(department.get(posion) == "Glbal Dual Degree학부") {

Intent intent = new Intent(DepList.this, DUAL.class);

startActivity(intent);

}

else if(department.get(posion) == "IT경영학부") {

Intent intent = new Intent(DepList.this, IT.class);

startActivity(intent);

}

}

}



이렇게 소스를 작성하였는데요...


그냥 리스트일경우에는 해당 학과 소개 페이지로 넘어가는데...


AutoCompleteTextView 을 이용하여 학과명을 입력하였을때 


위의 예제에서 2번째에 있는 국제경영학부를 AutoCompleteTextView 를 이용하여 


검색하여 클릭했을 때 국제경영학부(IBD.class) 가 아닌 제일 처음 입력한 


글로벌 리더쉽 자율전공( GLOBAL.class) 엑티비티로 이동합니다....


해결책을 얻을수있을까요...? 


다 갈아엎어야되는건 아닌지....