アプリケーションには 3 つのアクティビティがあります。
最初のアクティビティは、右から左にスライドするときのデフォルトのアクティビティです。2 番目のアクティビティはそのレイアウトで開く必要があり、左から右にスライドすると、3 番目のアクティビティはそのレイアウトで開く必要があります。背景やレイアウトだけでなく、スライドのアクティビティを変更したい..与えるこれを行う適切な方法。
このタブビューを使用していますが、これはスライダー機能を提供していません
public class TabDemo extends TabActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab_host);
TabHost tabHost=getTabHost();
// no need to call TabHost.Setup()
//First Tab
TabSpec spec1=tabHost.newTabSpec("activity 1");
spec1.setIndicator("activity 1");
Intent in1=new Intent(this, activity 1);
spec1.setContent(in1);
TabSpec spec2=tabHost.newTabSpec("activity 2");
spec2.setIndicator("activity 2");
Intent in2=new Intent(this,activity 2);
spec2.setContent(in2);
Toast toast = Toast.makeText(getApplicationContext(), "Welcome in Resident center",Toast.LENGTH_SHORT);
toast.show();
TabSpec spec3=tabHost.newTabSpec("activity 3");
spec3.setIndicator("activity 3");
Intent in3=new Intent(this,activity 3);
spec3.setContent(in3);
tabHost.addTab(spec1);
tabHost.addTab(spec2);
tabHost.addTab(spec3);
tabHost.setCurrentTab(1);
}
}