I'm just starting to play around with Android, and I'm stumped when
working with Google Maps.

The error I'm getting is this: "The application MapsTest (process
maps.google.maps.test) has stopped unexpectedly.  Please try again."

So far, my application is pretty bare-bones, which makes me think that
I'm missing something small, which I really need to resolve before
continuing.

Thanks for any suggestions.  Code listed below.

MapsTest.java:

import android.os.Bundle;
import android.widget.Button;

import com.google.android.maps.MapActivity;

public class MapsTest extends MapActivity
{
        Button refresh;
        @Override
        public void onCreate(Bundle savedInstanceState)
        {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
        }
        @Override
        protected boolean isRouteDisplayed() {
                // TODO Auto-generated method stub
                return false;
        }
}

main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android" style="@style/body">
        <Button android:id="@+id/refresh" style="@style/refresh" />
        <com.google.android.maps.MapView style="@style/maps"
android:apiKey="bogus" />
</LinearLayout>

style.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
        <style name="body">
                <item name="android:orientation">vertical</item>
                <item name="android:layout_width">fill_parent</item>
                <item name="android:layout_height">fill_parent</item>
        </style>
        <style name="maps">
                <item name="android:layout_width">fill_parent</item>
                <item name="android:layout_height">fill_parent</item>
                <item name="android:enabled">true</item>
                <item name="android:clickable">true</item>
        </style>
        <style name="refresh">
                <item name="android:layout_width">fill_parent</item>
                <item name="android:layout_height">wrap_content</item>
                <item name="android:text">@string/refresh</item>
        </style>
</resources>

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="maps.google.maps.test"
      android:versionCode="1"
      android:versionName="1.0.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".MapsTest"
                  android:label="@string/app_name">
                  <uses-library
android:name="com.google.android.maps" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-permission xmlns:android="http://schemas.android.com/apk/res/
android" android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission xmlns:android="http://schemas.android.com/apk/res/
android" android:name="android.permission.ACCESS_COARSE_LOCATION"></
uses-permission>
</manifest>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to