0
繼動畫的選項卡式活動是標籤式活動類的代碼無法在完成活動
public class TabbedActivity extends TabActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
setContentView(R.layout.inbox_tab_layout);
TabHost tabHost = getTabHost();
// Tab for Songs
TabHost.TabSpec loc = tabHost.newTabSpec("Confirm Location");
loc.setIndicator("Confirm Location");
Intent location = new Intent(this, LocationTab.class);
loc.setContent(location);
// Tab for Videos
TabHost.TabSpec edit = tabHost.newTabSpec("Medinfi");
edit.setIndicator("Add Details");
Intent videosIntent = new Intent(this, EditTab.class);
edit.setContent(videosIntent);
tabHost.addTab(loc); // Adding songs tab
tabHost.addTab(edit); // Adding videos tab
}
@Override
protected void onResume() {
super.onResume();
Data.activityResumed();
}
@Override
protected void onPause() {
super.onPause();
Data.activityPaused();
}
}
我試圖用overridependingintent
通過重寫onBackPressed使用下面的代碼中提到的動畫活動。
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
}
但是代碼不起作用。動畫不會執行,而是執行默認動畫。
感謝您的幫助,但我通過重寫完成()方法,而不是解決了這一 –