Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#267·SmartTabLayout

ViewPagerItemAdapter return null the first view

Author: andreasagapCreated Sep 3, 2018Updated Mar 24, 2022

Hi, I have a editText in the first viewpager's item. How I suppose to findViewById if the view is null?

adapter = new ViewPagerItemAdapter(ViewPagerItems.with(context)
                .add("Notes", R.layout.notes_layout)
                .add("Photo", R.layout.media)
                .create());
View view = adapter.getPage(0);
EditText notes = view.findViewById(R.id.notes_text);

Source: ogaclejapan/SmartTabLayout

View original on GitHubView discussion on GitHub