0

i have a fragment with a tab layout , so i slide to get into my map, when i get there it just opens the map but the markers dosnt show, my MapActivity is working good with the markers if i run it in a single activity, but how i can call the entire class in my tab layout fragment, here is what im doing

 else if(getArguments().getInt(ARG_SECTION_NUMBER) == 3) {
                if(view3 == null) {
//                    View rootView = inflater.inflate(R.layout.activity_maps, container, false);
//                    view3 = rootView;

                    View v = inflater.inflate(R.layout.activity_maps, container, false);
                    mMapView = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map));
                    mMapView.onCreate(savedInstanceState);

                    mMapView.onResume();// needed to get the map to display immediately

                    try {
                        MapsInitializer.initialize(getActivity().getApplicationContext());
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

                    return v;


                } else {
                    return view3;
                }

it seems like it only opens the activity_maps but it dont open my MapsActivity.class entirely

this is what i get

Not showing markers in my map

thanks

  • 1
    You have to set the markers right? How do you expect them to be there without setting them? – Eenvincible May 13 '17 at 16:06
  • @Eenvincible because i set them in my MapsActivity class, not there in the fragment, i just need to call my mapsactivity to execute in that tab layout –  May 13 '17 at 16:07
  • @ArmandoBarreda You can't use Activity code for a page in a ViewPager. Take all of your code from MapsActivity, and integrate it into a Fragment that extends SupportMapFragment. – Daniel Nugent May 13 '17 at 16:13
  • @DanielNugent yes we can, check the duplicate answer –  May 13 '17 at 16:32

0 Answers0