TabHost를 사용하여 2 개의 탭을 설정했습니다. 두 탭 모두 listview가 있습니다. 내가 각 항목을 클릭하면 항목을 클릭하면 작업이 완료되고, 내가 가지고있는 문제는 탭 2에 표시된 업데이트를 위해 응용 프로그램을 다시로드해야한다는 것입니다. 그래서 내가 원하는 것은 열 때입니다 탭은 각 열 때마다 탭에 대해 새로 고쳐집니다. 레이아웃을 얻으려면 필자의 탭 XML에 포함시킨다.Tab refresh (TabHost)
MainActivity에서 내 어댑터가 설정되었고 훌륭하게 작동했지만이 문제는 TabHost를 추가 한 이후에만 발생합니다.
// My contentMain
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<include
android:id="@+id/Onglet1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
layout="@layout/layouttab1" />
</LinearLayout>
// My adapter
ArrayAdapter<Store1> adapter = new MyTitleAdapter();
ListView myList = (ListView) findViewById(R.id.ListView);
adapterTitle.notifyDataSetChanged();
myList.setAdapter(adapter);
TabHost.TabSpec spec = host.newTabSpec("Tab One");
spec.setContent(R.id.tab1);
spec.setIndicator("First Tab");
host.addTab(spec);
TabHost host = (TabHost)findViewById(R.id.tabHost);
host.setup();
spec = host.newTabSpec("Tab Two");
spec.setContent(R.id.tab2);
spec.setIndicator("Secong Tab");
//host.setOnTabChangedListener();
host.addTab(spec);
addontabselectedlistener() –