diff options
author | Michael Kolb <kolby@google.com> | 2011-06-09 11:33:34 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-06-09 11:33:38 -0700 |
commit | 66af816cfbbfa2bbf2d35996e8024c8a6dc42a9c (patch) | |
tree | 45d1740608ead60a38c56a6cffaab21b43845ef3 /src/com/android/browser | |
parent | 032e9d154722343eade4292de1c7c9fdd47f89f6 (diff) | |
download | packages_apps_Browser-66af816cfbbfa2bbf2d35996e8024c8a6dc42a9c.zip packages_apps_Browser-66af816cfbbfa2bbf2d35996e8024c8a6dc42a9c.tar.gz packages_apps_Browser-66af816cfbbfa2bbf2d35996e8024c8a6dc42a9c.tar.bz2 |
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
Diffstat (limited to 'src/com/android/browser')
-rw-r--r-- | src/com/android/browser/NavScreen.java | 10 |
1 files changed, 3 insertions, 7 deletions
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(), |