From 58d8cb6a360eb57befcd4ea135e5f07499799887 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Mon, 21 Mar 2016 22:10:16 -0400 Subject: [PATCH] Fixed null pointer exception by properly replacing the fragment --- .../java/acr/browser/lightning/activity/BrowserActivity.java | 4 ++-- .../java/acr/browser/lightning/fragment/TabsFragment.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java index ec45343..3f9eba1 100644 --- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java @@ -316,8 +316,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements final FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager .beginTransaction() - .add(containerId, tabsFragment) - .add(R.id.right_drawer, bookmarksFragment) + .replace(containerId, tabsFragment) + .replace(R.id.right_drawer, bookmarksFragment) .commit(); if (mShowTabsInDrawer) { mToolbarLayout.removeView(findViewById(R.id.tabs_toolbar_container)); diff --git a/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java b/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java index 8071e59..f7fef3b 100644 --- a/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java +++ b/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java @@ -243,7 +243,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View } } - public class LightningViewAdapter extends RecyclerView.Adapter { + private class LightningViewAdapter extends RecyclerView.Adapter { private final int mLayoutResourceId; @Nullable private final Drawable mBackgroundTabDrawable;