summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-08-01 14:52:52 +0100
committerBen Murdoch <benm@google.com>2011-08-01 16:17:37 +0100
commita1a49b1cc247ebef83f348e99d28f899d51d41b1 (patch)
tree5f081faf656b8b64c73c835f47226a1f0663aeb9
parent914c5591baeb86bf30a5bc28930071442a822d60 (diff)
downloadpackages_apps_Browser-a1a49b1cc247ebef83f348e99d28f899d51d41b1.zip
packages_apps_Browser-a1a49b1cc247ebef83f348e99d28f899d51d41b1.tar.gz
packages_apps_Browser-a1a49b1cc247ebef83f348e99d28f899d51d41b1.tar.bz2
Don't cache the ComboViewActivity
Do not cache a reference to the ComboViewActivity in CombinedBookmarkHistoryView. Bug: 5084293 Change-Id: I7530c5d4b4710598873b12ea6feacf7f49934bef
-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) {