FragmentActivity on swiper tab

0

I am not able to insert a FragmentActivity to swiper tab:

@Override
    public Fragment getItem(int position) {
        switch (position) {case 0:
            return new HomeActivity();
        case 1:
            return new ListaBancada();

        }
        return null;

    }

The class is HomeActivity inherits from Fragment , the FragmentActivity List and the ListBank gives error in the above code, why? How do I call an Activity there?

    
asked by anonymous 01.06.2014 / 21:56

1 answer

2

You can not call. The getItem() method returns a Fragment , which is different from FragmentActivity , which despite being a activity to contain fragments , is still a Activity and not Fragment . Fragments are one thing, activities are another.

An activity may contain fragments , not the other way around. You will have to convert your activity into a fragment and use it in switch .

    
03.06.2014 / 15:24