3

我有这个对象,我想在关闭应用程序后保存它,并在应用程序再次运行时检索它。

final LatLng CENTRAL_VIEW = new LatLng(24.205835,-20.753174);


        CameraPosition cameraPosition = new CameraPosition.Builder()
        .target(CENTRAL_VIEW)      // Sets the center of the map to Central View
        .zoom(6)                   // Sets the zoom
        .build();                   // Creates a CameraPosition from the builder
        googlemap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

有什么简单的例子吗?谢谢!

4

3 回答 3

0

正如 Paresh 所说,我们不能将对象存储在其中,SharedPreference但我们可以使用一些外部库来修改我们的首选项,以像我一样存储对象。CustomSharedPreference

尝试使用它。

于 2013-01-31T11:50:00.953 回答
-1

将您的对象保存到共享首选项中,并在重新启动应用程序后获取.. 简单..

于 2013-01-31T11:43:32.357 回答