¡@

Home 

2014/10/16 ¤W¤È 08:17:24

android Programming Glossary: key_points

Restoring map state (position and markers) of Google Maps (V2) on rotate and on back (MapView in Fragment)

http://stackoverflow.com/questions/16236439/restoring-map-state-position-and-markers-of-google-maps-v2-on-rotate-and-on

public class MyMapFragment extends Fragment implements OnInfoWindowClickListener public static final String KEY_POINTS points private MapView mMapView private GoogleMap mMap private HashMap MyMapPoint Marker mPoints new HashMap MyMapPoint.. MyMapPoint points MyMapFragment fragment new MyMapFragment Bundle args new Bundle args.putParcelableArrayList KEY_POINTS points fragment.setArguments args return fragment @Override public void onSaveInstanceState Bundle outState super.onSaveInstanceState.. outState MyMapPoint points mPoints.keySet .toArray new MyMapPoint mPoints.size outState.putParcelableArray KEY_POINTS points @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState if savedInstanceState..