Browse Source

Fixed null pointer exception by properly replacing the fragment

master
Anthony Restaino 9 years ago
parent
commit
58d8cb6a36
  1. 4
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
  2. 2
      app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java

4
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(); final FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager fragmentManager
.beginTransaction() .beginTransaction()
.add(containerId, tabsFragment) .replace(containerId, tabsFragment)
.add(R.id.right_drawer, bookmarksFragment) .replace(R.id.right_drawer, bookmarksFragment)
.commit(); .commit();
if (mShowTabsInDrawer) { if (mShowTabsInDrawer) {
mToolbarLayout.removeView(findViewById(R.id.tabs_toolbar_container)); mToolbarLayout.removeView(findViewById(R.id.tabs_toolbar_container));

2
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<LightningViewAdapter.LightningViewHolder> { private class LightningViewAdapter extends RecyclerView.Adapter<LightningViewAdapter.LightningViewHolder> {
private final int mLayoutResourceId; private final int mLayoutResourceId;
@Nullable private final Drawable mBackgroundTabDrawable; @Nullable private final Drawable mBackgroundTabDrawable;

Loading…
Cancel
Save