2012-11-01 52 views
0

只要我將地圖添加到我的佈局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" 
     /> 

回答

0

剛剛寫下這下面的代碼

mapView = (MapView) findViewById(R.id.mapView); 
     mapView.preLoad(); 
+0

感謝名單:)它的工作原理 – Toygirl

+0

wc..any查詢? – ckpatel

+0

對不起。不明白 – Toygirl

相關問題