GithubHelp home page GithubHelp logo

Comments (10)

ogaclejapan avatar ogaclejapan commented on June 20, 2024 1

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.

ogaclejapan avatar ogaclejapan commented on June 20, 2024

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.

ogaclejapan avatar ogaclejapan commented on June 20, 2024

Sorry mistake.
Do not support because unnecessary instance.

from smarttablayout.

ppamorim avatar ppamorim commented on June 20, 2024

@ogaclejapan Based on what you said that?

from smarttablayout.

ogaclejapan avatar ogaclejapan commented on June 20, 2024

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.

ppamorim avatar ppamorim commented on June 20, 2024

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.

ppamorim avatar ppamorim commented on June 20, 2024

Well...
https://gist.github.com/ppamorim/295d6ef841d3a288ef78

from smarttablayout.

ogaclejapan avatar ogaclejapan commented on June 20, 2024

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.

ppamorim avatar ppamorim commented on June 20, 2024

How to do this?

from smarttablayout.

ppamorim avatar ppamorim commented on June 20, 2024

Solved!

from smarttablayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.