0
작은 문제가 있습니다. 나는 인터넷 전체를 들여다 보았지만 나의 문제에 대한 해결책을 찾을 수는 없다. 내가 가진 문제는 다음과 같습니다.Android ActivityGroup 뒤로 버튼
나는 3 개의 탭이있는 TabHost가 있습니다. 첫 번째 탭은 활동 A를 엽니 다. 활동 A에서는 목록보기를 누를 수 있으며 setContent()
이 활동 B로 바뀝니다. 활동 B에서 뒤로 버튼을 누르면 활동 A의 onBackPressed()
기능이 호출됩니다.
어떻게 활동 B를 닫고 활동 A onBackPressed()
으로 돌아갈 수 있습니까? 내가
public void switchToSecondActivity(){
tabHost.setCurrentTab(SECOND);
} //SECOND is an integer pointing location of the second activity. it starts from 0
을 RootActivity
에 그것을
private void onBackPressed(){
RootActivity parentActivity;
parentActivity = (RootActivity) this.getParent();
parentActivity.switchToSecondActivity();
} // here RootActivity is the tabhost
을 어떻게했는지