Comments (10)
Please try checked Don’t keep activities in the developer mode.
When you view again after returning to the home, it will change to a different instance.
Often occurs is similar events in low memory device.
@Override
public Object instantiateItem(ViewGroup container, int position) {
Object item = super.instantiateItem(container, position);
Log.d("DEBUG", "position: " + position + " " + item.toString());
if (item instanceof Fragment) {
mHolder.put(position, new WeakReference<Fragment>((Fragment) item));
}
return item;
}
from smarttablayout.
Hi, @ppamorim
Should use the v13 of utility.
//Optional: see how to use the utility.
compile 'com.ogaclejapan.smarttablayout:utils-v13:1.1.1@aar'
from smarttablayout.
Sorry mistake.
Do not support because unnecessary instance.
from smarttablayout.
@ogaclejapan Based on what you said that?
from smarttablayout.
Hi, @ppamorim
Fragment instance repeat creation and destruction on the ViewPager.
So, I think it is better to use the Fragment.instantiate(...)
rather than give an instance.
from smarttablayout.
You're wrong.
Only the view will be recreate, not a instance of the fragment.
I use the instance of the Fragment a long time on my applications.
from smarttablayout.
Well...
https://gist.github.com/ppamorim/295d6ef841d3a288ef78
from smarttablayout.
Hi, @ppamorim
Thank you upload the code.
What are the reasons why you think you have the better of this code than the current implementation?
I think enough in the current implementation to be instantiated when needed.
The library utility that provides adapters is optional,
if you want to use the adapter that you have pre-instantiation, please use to implement yourself.
Although I'm sorry,
Function to add a pre-instantiated fragment does not have plans to add to the utility.
from smarttablayout.
How to do this?
from smarttablayout.
Solved!
from smarttablayout.
Related Issues (20)
- PagerAdapter for View-based Page
- java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
- Its not working with ViewPager2? HOT 7
- Selected Text Color
- custom integration
- How to change tab text color dynamically from coding end.
- Background Color is not 100 percent white !!!
- how to set indicator's width to the textview's width
- Changing stl_defaultTabTextSize programmatically
- Nested Tabs
- Only works for 2 tabs. the 3rd tab does not render content HOT 1
- Me HOT 1
- H
- how to unselect all tab?
- Viewpager2 not supported
- How Do I disable scrolling right and left.
- 指示线跟文字根本不匹配 HOT 1
- Doesn't inherit font style from theme an style xml file
- How to get Indicator Thickness Trick 1 style for the tab buttons. HOT 1
- How do I set up icons instead of letters?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarttablayout.