Я пишу простое приложение для Android, которое должно отображать карты Google. Приложение отображает ошибку «Активность не отвечает» при запуске. В файле mapdisplay.xml
, где я определяю активность просмотра карты, я получаю сообщение об ошибке «Не удалось найти стиль 'mapViewStyle' в текущей теме», поэтому я думаю, что это является причиной сбоя.
У меня установлен набор разрешений для Интернета, и тег used-library правильно размещен в манифесте.
Вот код листинга
public class OnthisdayActivity extends MapActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mapdisplay);
}
@Override
protected boolean isRouteDisplayed()
{
return false;
}
}
И xml-файл mapdisplay.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<com.google.android.maps.MapView
android:enabled="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/mapView"
android:clickable="true"
android:apiKey="xxxxxx"
/>
</RelativeLayout>
и андроид манифест
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="onthisday.main"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:required="true" android:name="com.google.android.maps"/>
<activity android:name=".OnthisdayActivity"
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>
Спасибо