在xml中添加地图减慢应用程序的速度
问题描述:
只要我将地图添加到我的布局XML中,该活动就会加载得非常慢。很长时间后,它会跳转到活动并显示地图。我对此很新,任何帮助都会很好。在xml中添加地图减慢应用程序的速度
我发现一个网络链接,说我应该尝试延迟加载。我理解它,因为它将首先进入活动,然后加载地图。但我不知道如何实现这一点。
任何人都可以提供一个例子吗?
<com.google.android.maps.MapView
android:id="@+id/location_map"
android:layout_toRightOf="@id/rl_personaltrip_departure_times"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:enabled="true"
android:clickable="true"
android:apiKey="@string/maps_api_key"
/>
答
刚刚写下这下面的代码
mapView = (MapView) findViewById(R.id.mapView);
mapView.preLoad();
感谢名单:)它的工作原理 – Toygirl
wc..any查询? – ckpatel
对不起。不明白 – Toygirl