Android 如何创建SupportMapFragmen的新实例?

Android 如何创建SupportMapFragmen的新实例?,android,google-maps,google-maps-android-api-2,mapfragment,Android,Google Maps,Google Maps Android Api 2,Mapfragment,我有一个包含多个元素的列表视图。当我单击ListView的每个元素时,它会在FragmentActivity中加载一个Google地图,其中包含我之前放置的路由。但当我按下后退键并单击列表中的另一个元素时,地图上没有显示任何路线,并且显示我已经超过了最大航路点。如何重新实例化以加载新映射 这里有一些代码 GoogleMap mMap; try { Route ruta = new Route(); MapsInitializer.ini

我有一个包含多个元素的列表视图。当我单击ListView的每个元素时,它会在FragmentActivity中加载一个Google地图,其中包含我之前放置的路由。但当我按下后退键并单击列表中的另一个元素时,地图上没有显示任何路线,并且显示我已经超过了最大航路点。如何重新实例化以加载新映射

这里有一些代码

    GoogleMap mMap;

    try 
    {
        Route ruta = new Route();
        MapsInitializer.initialize(this);


        mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(3.4274051,-76.521492), 12));

        for(int i = 0; i < estaciones.size(); i++)
        {
            mMap.addMarker(new MarkerOptions()
            .position(estaciones.get(i))
            .title(nombreEstaciones[i])
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.busstop)));
        }

        ruta.drawRoute(mMap, this, waypoints, "es", true);

     } catch (GooglePlayServicesNotAvailableException e) {
         e.printStackTrace();
     }
GoogleMap-mMap;
尝试
{
路线ruta=新路线();
初始化(这个);
mMap=((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(NewLatlng51,-76.521492),12);
对于(int i=0;i
请为Route()添加代码,drawRoute()已解决我已解决在“onResume”上加载地图的问题。非常感谢。