http://developer.android.com/guide/tutorials/views/hello-mapview.html

So I've followed the steps to the end of step 6, where it says:
You can actually run this now, but all it does is allow you to pan
around the map.

However, I can't even get this to work. I get the following error
message:
The application Hello, MapView (process com.example.hellomapview) has
stopped unexpectedly. Please try again.
logcat returns a ClassNotFoundException error with the HelloMapView
class.

I use an AVD with the google api add-ons, and my i changed my build
properties to also build to the google api add-ons.

Here's my code for HelloMapView.java:

package com.example.hellomapview;

import android.os.Bundle;
import com.google.android.maps.MapActivity;

public class HelloMapView extends MapActivity {

        /** Called when the activity is first created. */
        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}


Here's my AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="com.example.hellomapview"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".HelloMapView"
                  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-sdk android:minSdkVersion="3" />
</manifest>

Here's my main.xml file (omitting part of the api key):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:id="@+id/mainlayout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <com.google.android.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="Y0ecDze1MZU..."
    />

</RelativeLayout>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
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