public class Setting extends ActivityGroup {
	TabHost mainTab;

	public void onCreate(Bundle savedInstanceState) {
		Intent intent;
		TabSpec tab;
		super.onCreate(savedInstanceState);
		setContentView(R.layout.setting);

		mainTab = (TabHost) findViewById(R.id.tabhost);
		mainTab.setup(getLocalActivityManager()); 

		intent = new Intent(this, Set_tempo.class);
		tab = mainTab.newTabSpec("tempo");
		tab.setIndicator("tempo");
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
		tab.setContent(intent);
		mainTab.addTab(tab);

		intent = new Intent(this, Set_key.class);
		// intent = new Intent(this, DateActivity.class);
		tab = mainTab.newTabSpec("key");
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
		tab.setIndicator("key");
		tab.setContent(intent);
		mainTab.addTab(tab);

		intent = new Intent(this, Set_quantize.class);
		tab = mainTab.newTabSpec("quantize");
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
		tab.setIndicator("quantize");
		tab.setContent(intent);
		mainTab.addTab(tab);

		intent = new Intent(this, Set_meter.class);
		tab = mainTab.newTabSpec("meter");
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
		tab.setIndicator("meter/score");
		tab.setContent(intent);
		mainTab.addTab(tab);
        }
}



ActivitiyGroup - A screen that contains and runs multiple embedded activities. (여러개의 액티비티들은 포함하고 작동시키는 스크린이다..?)


TabHost

void setup() - Call setup() before adding tabs if loading TabHost using findViewById()

void setup(LocalActivityManager activityGroup) - If you are using setContent(android.content.Intent), this must be called since the activityGroup is needed to launch the local activity.(setContent 사용전에 사용할것, local액티비티에 접근하기 위해 반드시 불러야한다.?)

LocalActivityManage , getLocalActivityManager - Helper class for managing multiple running embedded activities in the same process. This class is not normally used directly, but rather created for you as part of the ActivityGroup implementation. (한 프로세스에서 여러개 액티비티를 관리하는것을 도와주는클래스?)

newTabSpec - 탭호스트의 한요소가 된다.


Intent

setFlags - Set special flags controlling how this intent is handled





안드로이드 강좌는 많지만 뭔가 필요한건 생각보다 뙇뙇! 나오지 않는다. 슬픔..ㅠㅠ

이것도 하루종일 진짜 이상한데서 오류나서 헠헠거리면서 했다. 

하고나니깐 별거없어서 허무함


'정리중 > Android' 카테고리의 다른 글

안드로이드 동적으로 버튼사이즈 조정  (0) 2014.08.03
APK파일로 내보내기  (0) 2014.07.19
kankan wheel  (0) 2014.07.19
다이얼로그 제목없애기  (0) 2014.07.19
16진수 색상규칙  (0) 2014.07.17

+ Recent posts