2013-01-04 97 views
1

我正在將谷歌地圖整合到我的android應用中。android map not display

它工作正常。

但是,過了幾天我的地圖不顯示,我不知道爲什麼?

有人可以建議我爲什麼嗎?

我沒有改變我的代碼中的任何東西。

在此先感謝。

<?xml version="1.0" encoding="utf-8"?> 
<com.google.android.maps.MapView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/mapview" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:clickable="true" 
    android:apiKey=""/> 
+0

互聯網在設備上工作? – AndroidLearner

回答

2

只需生成一個新密鑰並在xml中再次使用它。它應該解決您的問題。

+0

這應該是在評論 – SilentKiller

+0

@Sri:你的意思是我想重複像第一我如何生成API密鑰? – SelvaMariappan

+0

@Selva:激動人心,bcoz你的密鑰庫文件可能會被新生成。所以請嘗試相同的步驟並獲得新的密鑰。 – Sri

2

請看看這個link

它可以幫助你。

1

你刷新了你的android調試密鑰嗎?當您更改工作環境或從磁盤刪除.android文件夾時會發生這種情況。嘗試爲地圖創建新的密鑰。 這裏是命令:

C:\ Program Files \ Java \ jdk1.7.0_07 \ jre \ bin> keytool.exe -list -v -alias androiddebugkey -keystore C:\ Users \ User.android \ debug.keystore -storepass的android -keypass安卓

0

生成並添加你自己的密鑰

<?xml version="1.0" encoding="utf-8"?> 
<com.google.android.maps.MapView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/mapview" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:clickable="true" 
    android:apiKey="Your Maps API Key goes here" 
/> 

轉到throught這些鏈接,希望它可以幫助你

link for maps intro

link to Generate key for map