New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fragment reloads completely again on tab selection #65
Comments
have the same problem |
+1 |
@vj-1023 @studyfordream @jatin-lakhani Hi guys, sorry for the delay of my answer. I'm currently working on an app which includes this library and I've tried to make something smooth and efficient (BTW, the demo is very simple, it doesn't show how to manage efficiently fragments, it's just here to show that you can manage one or more fragments per tab). My solution (which is certainly not the best one) is to use a ViewPager to host the fragments. I have slightly modified the ViewPager class for my needs (mainly to avoid the swipe between the pages). Why use the ViewPager? Because this class is already ready to manage pages (and so fragments), and you can use the method If you need an example, I could improve the demo to show you how I have implemented it (and maybe some users will have ideas to improve the code). |
Thanks for the replay. Its better for us if you provide demo as you have already implemented. Thanks |
@aurelhubert |
@vj-1023 @studyfordream @jatin-lakhani @jagatappv Hi guys, the demo has been updated with a AHBottomNavigationViewPager. You can check the classes here: https://github.com/aurelhubert/ahbottomnavigation/tree/master/demo/src/main/java/com/aurelhubert/ahbottomnavigation/demo |
@aurelhubert
Hi,
I m new to android & I thank you for such a simple and neat library.
Although there is a small issue, This is a very fundamental problem which i faced, may be not completely linked to the library but yes it would make the implementation better.
I according to your documentation setup my activity & several fragments which i want to show for every tab on it's click. The problem here is my fragments make network calls to fetch data from the database to show lists & recycler-views !
but every time i reselect the tab, the onCreate(), onCreateView(), onActivityCreated() is called which makes my app to call for the data again & again which is not required ! once the feed data is loaded we don't need to reload it again everytime the tab is selected.
is there a work around for this, that the fragment doesn't reload again and app is efficient on data usage.
The text was updated successfully, but these errors were encountered: