From c010cb0479bc6914aea7e6231fa86e60a9c237d0 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:06:25 -0400 Subject: Set ViewPager2 adapter in onCreate in ViewPostDetailActivity. --- .../infinityforreddit/activities/ViewPostDetailActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index 1e64bf89..27962063 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -282,6 +282,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele }); sectionsPagerAdapter = new SectionsPagerAdapter(this); + binding.viewPager2ViewPostDetailActivity.setAdapter(sectionsPagerAdapter); checkNewAccountAndBindView(savedInstanceState); } @@ -362,7 +363,6 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele } private void bindView(Bundle savedInstanceState) { - binding.viewPager2ViewPostDetailActivity.setAdapter(sectionsPagerAdapter); if (savedInstanceState == null) { binding.viewPager2ViewPostDetailActivity.setCurrentItem(getIntent().getIntExtra(EXTRA_POST_LIST_POSITION, 0), false); } -- cgit v1.2.3