ListFragment no carga el list implicito
Publicado por fran (4 intervenciones) el 13/04/2016 18:15:22
Hola xicos estoy realizan pruebas con un ViewPager y añadiendo fragment y ListFragments a sus pages, los frgaments que no tienen problema al cargarse en los page pero el listfragment si me da problemas. A continuación dejo el código donde aparece el problema:
Codigo de SampleAdapter extendiendo a FramePagerAdapter
hast aqui todo bien, pero cuando se selecciona la page 6 el codigo
del SociualListFragment extendiendo a ListFragment:
un vez devuelto el listFrag aparece el error Fragmnent is not available
Codigo de SampleAdapter extendiendo a FramePagerAdapter
1
2
3
4
5
6
7
8
9
10
11
12
@Override
public Fragment getItem(int position) {
if (position == 6) {
return (SocialListFragment.newInstance(position));
}
else if (position == 2) {
return (OtherFragment.newInstance(position));
}
return (EditorFragment.newInstance(position));
}
hast aqui todo bien, pero cuando se selecciona la page 6 el codigo
del SociualListFragment extendiendo a ListFragment:
1
2
3
4
5
6
7
8
9
10
public static SocialListFragment newInstance(int position) {
//if (list == null) {
Bundle args = new Bundle();
args.putInt(KEY_POSITION, position);
SocialListFragment listFrag = new SocialListFragment();
listFrag.setArguments(args);
//}
return listFrag;
}
un vez devuelto el listFrag aparece el error Fragmnent is not available
Valora esta pregunta


0