From 66af816cfbbfa2bbf2d35996e8024c8a6dc42a9c Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Thu, 9 Jun 2011 11:33:34 -0700 Subject: fix close last page bug Bug: 4586081 changed behavior of closing last page to exit the browser (consistent with tablet UI) this eliminates the state where browser doesn't have a current page which caused the original bug Change-Id: If933c6f14b6ae0c5c95fc8e656bbd909f6cb09b7 --- src/com/android/browser/NavScreen.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/com/android/browser/NavScreen.java') diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index 6ef759f..eeca95a 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -169,16 +169,12 @@ public class NavScreen extends RelativeLayout implements OnClickListener { private void onCloseTab(Tab tab) { if (tab != null) { - mUiController.closeTab(tab); - if (mUiController.getTabControl().getTabCount() == 0) { - openNewTab(); - } else { - mAdapter.notifyDataSetChanged(); - } + switchToSelected(); + mUiController.closeCurrentTab(); + mAdapter.notifyDataSetChanged(); } } - private void openNewTab() { // need to call openTab explicitely with setactive false Tab tab = mUiController.openTab(BrowserSettings.getInstance().getHomePage(), -- cgit v1.1