Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
600 views
in Technique[技术] by (71.8m points)

java - Android "Failed to find style 'mapViewStyle' in current Theme" error

I'm writing a simple android application that should display google maps. The application displays the "Activity is not responding" error upon startup. In the mapdisplay.xml file where I define the map view activity, I get a "Failed to find style 'mapViewStyle' in current Theme" error message, so I think it's the reason behind the crash.

I have the Internet permission set and the uses-library tag placed correctly in the manifest. Here is the code listing

public class OnthisdayActivity extends MapActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mapdisplay);
}
@Override
protected boolean isRouteDisplayed()
{
    return false;
}
}

And the xml file 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>

And the android manifest

<?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>

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...