Questions tagged [fragmentpageradapter]
FragmentPagerAdapter is a subclass of the PagerAdapter class from the Android compatibility package that represents each page, in the ViewPager where is used, as a Fragment.
603
questions
0
votes
0
answers
24
views
Type mismatch: inferred type is SectionPagerAdapter but RecyclerView.Adapter<(raw) RecyclerView.ViewHolder!>? was expected
I learned about SectionPagerAdapter & RecyclerViews and tried to create one after watching this tutorial. Everything was going fine until the end when I got an error while running the code
The ...
0
votes
1
answer
49
views
FragmentPagerAdapter is deprecated problem
Android Studio says fragment pager adapter is deprecated.
How can I remove this error? here is the screenshot
public static class ViewPagerAdapter extends FragmentPagerAdapter {
private ArrayList&...
0
votes
0
answers
135
views
How to set primary item after update to viewpager2 and FragmentStateAdapter?
I'm looking into an opensource project on github and it still currently makes use of ViewPager and FragmentStatePagerAdapter.
I'm trying to update it to use ViewPager2 and FragmentStateAdapter but ...
0
votes
1
answer
28
views
viewpager call only 2 oncreateview
i have 4 Fragments in viewpager
but if i get into activity that have viewpager
only 2 fragments call oncreateview
so remain fragments cant call their component and occurs null pointer error
i have ...
3
votes
2
answers
392
views
RecyclerView onClick event is not working with SwipeRefreshLayout?
Before using FragmentStateAdapter. I was using FragmentPagerAdapter then everything was fine but when I migrated from FragmentPagerAdapter to FragmentStateAdapter to reduce memory usage. The issue ...
0
votes
0
answers
141
views
FragmentPagerAdapter class is deprecated. How to solve FragmentPagerAdapter issue
FragmentPagerAdapter class is deprecated
Since API 27 FragmentPagerAdapter is deprecated. What's the best alternative to use for this?
How to solve FragmentPagerAdapter issue.
Follow my code you ...
0
votes
0
answers
207
views
App crashes when returing to MainActivity after screen rotation
When i go from MainActivity to EditTaskActivity (a screen where you can edit task options), rotate the screen and then try to save the task, the app crashes.
Now i found out that it crashes inside ...
1
vote
1
answer
425
views
Using ViewPager2 with TabLayout and fragments. Able to swap fragments, updated fragment not showing unless the user browses to another tab first
I am updating an application that was written in 2014. The fragment that I would like to update (refresh) uses the following code,
public void fragmentRefresh(View view) {
FragmentTransaction ft = ...
0
votes
1
answer
439
views
Move to next slide on clicking radio button inside View Pager
I am making an app that contains a small questionnaire for users asking them about their food preferences. To achieve this, I am trying to create a ViewPager whose layout contains Radiobuttons inside ...
0
votes
1
answer
811
views
How to extends FragmentPagerAdapter class?
When I try to extend their class, the FragmentPagerAdapter is deprecated in my Android Studio page code. The problem is very annoying. I have searched a lot but have not found any results.
Please have ...
0
votes
1
answer
40
views
Is it safe to assume that adjacent fragments in a ViewPager will always have their UI active?
I have a ViewPager with FragmentPagerAdapter. I don't override offscreenPageLimit property with setOffscreenPageLimit of my ViewPager. So, in this case the value of the offscreenPageLimit is 1 which ...
3
votes
1
answer
3k
views
java.lang.IllegalStateException: Fragment already added: MovieFragment
got error fragment already added on my MyPagerAdapter class which extends FragmentPagerAdapter
this is my error logs
E/AndroidRuntime: FATAL EXCEPTION: main
Process: id.cahyowhy....
0
votes
0
answers
421
views
In ViewPager2 recreate fragment at specific index
I'm using ViewPager2 and with FragmentStateAdapter to retain state of fragments. I show 2 fragments in the pager when user is loggedOut but when user logins again the i want to recreate only the 2nd ...
1
vote
1
answer
341
views
Switch to Fragment through swipe up/down
I'm having some trouble with implementing a certain feature within my app. What I would like to achieve is being able to swipe up/down to see certain fragments.
I am currently using a ViewPager to ...
0
votes
1
answer
27
views
updating data in ListViews displayed with a FragmentPagerAdapter
i try to display Datasets in severel Listview in a fragment in a FragmentPagerAdapter.
The different datasets partly depend on each other (if displayed data in tab A get's changed, data in tab B ...
0
votes
1
answer
300
views
SectionsStatePagerAdapter deprecated error
I have developed a section state pager adapter that is meant to help with the fragments in the account settings of the mobile application. However I can't seem to figure out where I've gone wrong.
...
2
votes
1
answer
151
views
Fragment in ViewPager using FragmentPagerAdapter is blank the first time activity is loaded
I'm creating an app with vertical page adapter using FragmentStatePagerAdapter. The big issue i'm facing is, data is not displayed on the textview on first app launch but is displayed on scrolling the ...
1
vote
0
answers
124
views
FindViewById is null after device rotation inside FragmentPagerAdapter
I am trying to modify UI elements that are inside a FragmentPagerAdapter on a ViewPager.
Everything goes well until I rotate the device. Then, FindViewById returns null and I can't modify the element....
0
votes
0
answers
1k
views
error: cannot find symbol variable viewpager ---Androidx
I have the following code, the project is migrated to andoidx, R.id.viewpager returns can not find symbol variable viewpager SimpleFragmentPagerAdapter is a custom(an extention of)
...
2
votes
1
answer
83
views
tabs with date as title
I need tab layouts with the titles as dates in it. In my pager adapter I'm using the following code.
private static final int[] TAB_TITLES = new int[]{R.string.home_tab1, R.string.home_tab2, R.string....
0
votes
1
answer
137
views
Fragment inside Viewpager not show when revisited
I have two fragments in my Activity. One contains a viewpager which also has two fragments in it. Everything works fine but the problem is when i re-visit the fragment containing the viewpager from ...
0
votes
3
answers
705
views
getResources() not working in FragmentPagerAdapter [duplicate]
I try to populate tab titles in FragmentPagerAdapter by strings from string.xml. I check a few different ways to do that based on StackOverlow or another sources. Below I present my newest version of ...
0
votes
1
answer
155
views
FragmentPagerAdapter always starts from the first page
I have a Fragment pager adapter with five fragments and inside the third fragment I want to call an other activity which sends a selected picture to the container. It works fine but, every time the ...
0
votes
0
answers
22
views
ListView SimpleCursorAdapter FragmentPagerAdapter Tabs
I thought long and hard about how to represent this problem. I thought that there is too much code but that I can describe it simply. And that this will probably tip someone off as to where the ...
0
votes
1
answer
39
views
How to get the current item inside FragmentPagerAdapter?
I have the following code -
@Override
public void sendDeviceIdResult(String deviceId, boolean isAlreadyExist) {
int currentItem = viewPager.getCurrentItem();
Fragment item = adapter....
2
votes
2
answers
1k
views
Getting user-input information back from viewPager fragments (Kotlin)
I'm working in Android Studio and I've run into an issue I've never encountered before.
I'm making an interface that brings in JSON to create custom forms and creates a series of tab-controlled ...
1
vote
0
answers
811
views
Exoplayer not stopping after app closes in PagerAdapter
I have problem with Exoplayer to stopping after the app is closed down, or the fragment is changed from the BottomNavigationView, I get the data from my API that is cast to a Recyclerview/Adapter that ...
1
vote
0
answers
209
views
Using Tabs Navigation in Xamarin Android MvvmCross return incorrect index
I need advice from an MvvmCross expert!! I have recently taken over a codebase that is an Android/iOS app using Xamarin Native and MvvmCross. The app has a TabView as the main navigation pattern and ...
1
vote
1
answer
840
views
How to change fragment inside getItem of FragmentStatePagerAdapter
I have this code, where I want the first fragment of my FragmentStatePageAdapter(inside a viewpager), to change, depending on some boolean values.
inner class MainFragmentAdapter(fragmentManager: ...
0
votes
2
answers
140
views
How to understand getFragments.size() giving me 2 when I've got 3 tabs in TabLayout each showing the right fragment?
I've got TabLayout with 3 tabs created via ViewPager using FragmentPagerAdapter and 3 fragments. Swiping to the third tab, breaks one bit of the first tab and changes the indexing of the fragments.
I'...
1
vote
0
answers
46
views
TimeoutException on ViewPager setAdapter Android
I am developing Android App and I am using view pager inside a fragment but when I tried to setAdapter it's showing me Failed to execute a task.
java.util.concurrent.TimeoutException
Here how I am ...
0
votes
1
answer
139
views
Remove Fragment Page from ViewPager
I'm trying to dynamically add and remove Fragments from a ViewPager, adding works without any problems, but removing doesn't work at all.
What am I doing wrong? Please help.
I've tried many solutions....
1
vote
2
answers
592
views
First Fragment View not loading when navigate from third fragment
Here when I landed to first fragment all views are loaded and scrolling but when I come from third fragment i.e from some other activity I need to land in third fragment,and when navigate to first ...
3
votes
1
answer
3k
views
Vertical ViewPager with smooth scrolling and page transformation like inshorts app
I wanted to make a Vertical ViewPager looklike inshorts application.
I have tried several solutions found on Stack Overflow and in Github.
All of them have the same way of implementation of code, and ...
105
votes
7
answers
85k
views
FragmentPagerAdapter deprecated
Since API 27 FragmentPagerAdapter is deprecated. What's the best alternative to use for this?
In my case, I understand something like super(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) ...
0
votes
4
answers
4k
views
TabLayout don't get populated with ViewPager at all
I try to populate a TabLayout with a ViewPager but unfortunately it doesn't get populated.
I followed this tutorial to get in touch: TabLayout and ViewPager in your Android App. The tutorial uses the ...
0
votes
0
answers
15
views
How can I switch between fragments on the click of a button and transfer data from one another?
This is the code I'm dealing with right now - we were given it during class and I didn't fully understand it and i'm trying to do so and add some features too - that's why I'm here.
MAIN ACTIVITY:
...
-1
votes
1
answer
318
views
i have a dynamic tablayout but every time i push back button and re-enter my app again , my tab doubles , why?
in my TabLayout i create my login TabItem dynamically at the onCreate() method of my MainActivity , but every time i exit from my application with back button and i re-enter my app , it creates that ...
0
votes
0
answers
40
views
How to build a ViewPager to slide large images?
I´m trying to use a ViewPager to slide a group of images using a FragmentPagerAdapter. So each instance of my fragment will show a single image.
I will describe below my understanding of how to do it:...
3
votes
0
answers
216
views
onLoadFinished() not getting called, but onCreateLoader() is called
I am using CursorLoader to load data from database inside my Fragment, which has a RecyclerView. This fragment is being used inside a ViewPager. The ViewPager is contained inside a ContainerFragment, ...
0
votes
2
answers
463
views
how to fix" 3 fragment in One activity with viewPager need validation first two page then possible to go third page"
I want to create a createOrderActivity where has three fragments like Service info, ScheduleInfo, confirmation
the service info fragment has editText
if click NextButton(which is situated ...
1
vote
1
answer
84
views
ViewPager Fragment RecycleView Reset
I have 3 fragments in the ViewPager.
PersonalFragment
CropFragment
NotesFragment
Every fragment has a RecyclerView and I was adding items using a dialog in it. However, when I go to the last ...
0
votes
2
answers
992
views
How to use the FragmentPagerAdapter with unique unrelated fragments?
I am trying to implement a simple swiping action between the three main screens of my app (feed, forum & profile).
I've been looking for guides online but they all seem to take the same approach ...
3
votes
3
answers
2k
views
How to pass data between fragments in FragmentPagerAdapter
For my academic project, I want create an application with 4 tabs. The first one will show recent games added to a list, the second one will be a search form, the third will show the search result, ...
0
votes
0
answers
102
views
How to make not selected fragments appear a little smaller than the currently selected fragment
I'm using a FragmentPagerAdapter to create carousel between 3 fragments. I've achieved it, but I'd like to make the adjacent fragment appear a little smaller, like in the following:
My code:
...
0
votes
1
answer
154
views
SearchView cancels with page change but doesn't clear properly
I have a fragment pager that pages between instances of the same Fragment. On top of those fragments, a search function is implemented via a SearchView in the App bar. The user should be able to ...
0
votes
1
answer
87
views
Refreshing Data in a fragment using FragmentPagerAdapter
I have three fragments in my Pager and i am adding some strings using Bundle
while instantiating each fragment in my adapter. I am using these strings to filter out the data that i am fetching from ...
0
votes
1
answer
114
views
viewpager,recylerview not working if using same fragment for all tabs
i am using the same fragment for all the tabs.
But the problem is scroll of the recycler view of fragment working for last tab only.
Recycler view not scrolling for the previous tabs.
Below is my ...
0
votes
0
answers
166
views
Fill linearlayout with cardviews and viewpager
I have an issue trying to fill a linear layout with cardviews inside, and inside of these, a view pager that is filled with two fragments. the fragments are filled with data stored in an SQLite ...
0
votes
1
answer
714
views
FragmentPagerAdapter Fragment getItem wrong position?
So for some reason i'm getting a wrong position when i switch tabs on my tabbed activity.
At the bottom of my post you can see my logcat when i start my app, tab 1 and tab 2 their oncreateview is ...