FragmentStateAdapter1 ViewPager2(FragmentStateAdapter)에서 화면이 reload되는 현상 해결법 (ViewPager2 + FragmentStateAdapter + BottomNavigationView) 이번에 ViewPager2 + FragmentStateAdapter + BottomNavigationView를 구현하여 화면을 구성했다.. 구글에 널려있는 코드로 FragmentStateAdapter를 아래와 같이 구현했다. // Sample code이기 때문에 NUM_PAGES와 실제 switch문의 차이는 있습니다. private final int NUM_PAGES = 4; class fragmentAdapter extends FragmentStateAdapter { public fragmentAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle) { super(fragmentManager, lifecycle); .. 2021. 11. 5. 이전 1 다음