summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-08-02 02:01:03 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-02 02:01:03 -0700
commit979013116ebf9a38824af041a4518ccbaa2ad231 (patch)
treea9e03095cd66833c6ad7da94f1c63f20326159af /src
parent329bce3c16d421ec4197f1cb0614b6ad222dc46f (diff)
parenta1a49b1cc247ebef83f348e99d28f899d51d41b1 (diff)
downloadpackages_apps_browser-979013116ebf9a38824af041a4518ccbaa2ad231.zip
packages_apps_browser-979013116ebf9a38824af041a4518ccbaa2ad231.tar.gz
packages_apps_browser-979013116ebf9a38824af041a4518ccbaa2ad231.tar.bz2
Merge "Don't cache the ComboViewActivity"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/CombinedBookmarkHistoryView.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/browser/CombinedBookmarkHistoryView.java b/src/com/android/browser/CombinedBookmarkHistoryView.java
index 7903709..86afe1e 100644
--- a/src/com/android/browser/CombinedBookmarkHistoryView.java
+++ b/src/com/android/browser/CombinedBookmarkHistoryView.java
@@ -52,8 +52,8 @@ public class CombinedBookmarkHistoryView extends LinearLayout
final static int FRAGMENT_ID_HISTORY = 2;
final static int FRAGMENT_ID_SNAPSHOTS = 3;
- private Activity mActivity;
private ActionBar mActionBar;
+ private FragmentManager mFragmentManager;
private Bundle mExtras;
@@ -117,15 +117,15 @@ public class CombinedBookmarkHistoryView extends LinearLayout
CombinedBookmarksCallbacks cb, ComboViews startingView,
Bundle extras) {
super(activity);
- mActivity = activity;
mExtras = extras;
- mActionBar = mActivity.getActionBar();
+ mActionBar = activity.getActionBar();
mCallback = cb;
+ mFragmentManager = activity.getFragmentManager();
View v = LayoutInflater.from(activity).inflate(R.layout.bookmarks_history, this);
v.setOnTouchListener(this);
- mBookmarksHeader = new FrameLayout(mActivity);
+ mBookmarksHeader = new FrameLayout(activity);
mBookmarksHeader.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.MATCH_PARENT,
@@ -181,9 +181,8 @@ public class CombinedBookmarkHistoryView extends LinearLayout
if (mCurrentFragment == FRAGMENT_ID_HISTORY) {
// Warning, ugly hack below
// This is done because history uses orientation-specific padding
- FragmentManager fm = mActivity.getFragmentManager();
mHistory = BrowserHistoryPage.newInstance(mCallback, mHistory.getArguments());
- fm.beginTransaction().replace(R.id.fragment, mHistory).commit();
+ mFragmentManager.beginTransaction().replace(R.id.fragment, mHistory).commit();
}
}
@@ -236,8 +235,7 @@ public class CombinedBookmarkHistoryView extends LinearLayout
tearDownActionBar();
if (mCurrentFragment != INVALID_ID) {
try {
- FragmentManager fm = mActivity.getFragmentManager();
- FragmentTransaction transaction = fm.beginTransaction();
+ FragmentTransaction transaction = mFragmentManager.beginTransaction();
if (mCurrentFragment == FRAGMENT_ID_BOOKMARKS) {
transaction.remove(mBookmarks);
} else if (mCurrentFragment == FRAGMENT_ID_HISTORY) {