安卓:不幸的是谷歌地图停止 [英] Android : Unfortunately google maps stopped
本文介绍了安卓:不幸的是谷歌地图停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
main.xml中和放大器;的manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:state_enabled="true"
android:apiKey="0hiUaVXTa9WGmYKpnOEIfy2HddhBcpBTrIc1Qnw" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Map.test"
android:versionCode="1"
android:versionName="1.0" >
<application android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".GoogleMaps" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
GoogleMaps.java
import com.Map.test.R;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class GoogleMaps extends MapActivity {
private MapView mapView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.map_view);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
Eclipse中没有显示任何错误在我的code,也模拟器中运行,但最终我得到不幸的是谷歌地图已停止错误。
可我知道什么是在这个code中的问题?
Eclipse is not showing any error in my code and also emulator running but finally i'm getting "Unfortunately google maps stopped" error. May i know what is the problem in this code ?
推荐答案
您是否尝试过不同的API密钥?我前阵子前有同样的问题,我是用一个调试关键,我不得不产生一个新的密钥并使用它。我会尝试,首先看看会发生什么。
Have you tried a different API Key? I had the same problem a while back ago and I was using a debug key, I had to generate a new key and use that. I would try that first and see what happens.
这篇关于安卓:不幸的是谷歌地图停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文