안드로이드 개발 질문/답변
(글 수 45,052)
public boolean onTap(int index) { //표식 클릭시에 이벤트 Class <?> sight[] = new Class[] {sight0.class, sight1.class}; OverlayItem item = getItem(index); Intent intent = new Intent(Location.this, sight[index].class); //class에서 에러 startActivity(intent); return true; }
지금 구글맵에 마커들을 띄우고 마커를 클릭하면 해당하는 정보화면으로 이동할 수 있도록 코드를 작성중입니다.
해당정보들은 각 클래스들(sight0.class, sight1.class,,,등등)로 만들어져있습니다.
클래스들을 배열로 묶은다음에 index 값을 이용해서 액티비티를 불러오게끔 하려고 하는데 잘 안되네요
Intent intent = new Intent(Location.this, sight[index].class); 이부분에서 클래스명만 들어올수 있고 저런식으로 sight[index]가 들어올수는없는건가요? 어떤식으로 처리해야 할까요 조언 좀 부탁드립니다!