ncapdevi / FragNav

An Android library for managing multiple stacks of fragments
1.5k stars 220 forks source link

rootFragments has private access on com.ncapdevi:frag-nav FragNavController? in java #184

Closed hemanth-sp closed 5 years ago

hemanth-sp commented 5 years ago

` //list of fragments List fragments = new ArrayList<>(3);

    //add fragments to list
    fragments.add(FirstFragment.newInstance(0));
    fragments.add(SecondFragment.newInstance(0));
    fragments.add(ThirdFragment.newInstance(0));
    //link fragments to container
    fragNavController = new FragNavController(getSupportFragmentManager(), R.id.container);
    fragNavController.rootFragments = fragments; // i am getting error here`
webserveis commented 5 years ago

try with:

    fragNavController.setRootFragments(fragments);
hemanth-sp commented 5 years ago

error : java.lang.IndexOutOfBoundsException: Can't switch to a tab that hasn't been initialized, Index : 0, current stack size : 0. Make sure to create all of the tabs you need in the Constructor or provide a way for them to be created via RootFragmentListener.

malwinder-s commented 5 years ago

Still getting this issue.