2016-09-05 1 views
-2

목록 요소 및 탭 패널 내용이 json 파일에서 채워집니다. 요소를 listview1에서 클릭하면 tabbeddpanel (위)으로 이동해야합니다. I는 listview1B에게 소자를 누르면 Android 동적 목록을 다른 화면으로 보시겠습니까?

그것은 listview2 화면으로 이동하는 난 listview2B1 요소를 클릭 할 때 (아래) tabbedpanel로 이동한다. 이

enter image description here

답변

1

을하고있는

도움말 나 여기에 태그를 추가 할 수 있도록 listview1에 전달 된 데이터 세트를 수정합니다.

예를 들어 listview1에 전달하는 데이터 세트는 tis 개체의 ArrayList입니다.

public class myData { 
    private String content; 
    private int tag; // Add a tag attribute to handle them differently in the list. 
} 

// Here's the list passed to your `listview1` 
private ArrayList<myData> myDataList = new ArrayList<myData>(); 
그 위치의 개체의 tag에 대한 bindView 기능 검사 내부 지금

과 같은 다른 작업을 처리합니다.

if(myDataList.get(position).getTag() == 0) { 
    // Do this 
} else { 
    // Do something else 
} 
+0

감사합니다. 잘하셨습니다. – user2709752

+0

태그 변수 만 사용합니다. bindView 함수가 아닙니다. – user2709752

+0

도움이 된 기쁨 –

관련 문제