I'm developing an app with tabs and swipe. In the tabs I load a fragment with text and images but, when I try to put a Map, It returns error. In the FragmentActivity I have this:
public Fragment getItem(int position) { Fragment newfragment; if (position == 0) { newfragment = new Fragment1(); } else if (position == 1) { newfragment = new Fragment2(); } else if (position == 2) { newfragment = new Fragment3(); } else if (position == 3) { newfragment = new MapFragment(); } else { newfragment = new StartFragment(); } return newfragment; }
MapFragment.java extends from Fragment and the Logcat says I need to call an MapActivity, but I don't find in what way I call a MapActivity and fill the fragment with the MapActivity...