1. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Map API - activity crashes on launch

Discussion in 'Android Hacks and Help' started by UNEXPECTED62, Apr 3, 2010.

  1. UNEXPECTED62
    Offline

    UNEXPECTED62 New Member

    Joined:
    Dec 28, 2009
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I am using the Android Map API for the first time to embed a map in my application. I have done a lot of searching and most tutorials line up, and I have followed everything as far as I can tell very accurately, but still when my activity with the map launches, it crashes instantly.

    My class with the map is not my main class, it launches when a button is pressed. Initially the app is fine, and when I hit the button that starts my activity with the map, it crashes. Lets call that activity, "MoreInfo".

    So, my "More Info" extends com.google.android.maps.MapActivity, and imports that same thing as well. I also import com.google.android.maps.MapView, and android.os.Bundle. What is strange to me is that com.google.android.maps.MapActivity and MapView are yellow underlined, saying they are not used. This is technically true because I have nothing interacting with them programatically as of yet.

    The MoreInfo.xml fine for the GUI, has this LinearLayout embedded into a RelativeLayout

    Code:
    <LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
                    android:id = "@+id/show_on_map"
                    android:orientation="vertical"
                    android:layout_width="310dip"
                    android:layout_height="240dip"
                    android:layout_below = "@+id/location_box"
                >
                    <com.google.android.maps.MapView 
                        android:id="@+id/mapview1"
                        android:layout_width="fill_parent" 
                        android:layout_height="fill_parent" 
                        android:enabled="true" 
                        android:clickable="true" 
                         android:apiKey="0QgcCar5Krn4WHy3D3XIIOtCXu8UkYTFR3XYNug" 
                    /> 
                </LinearLayout>
    My Android Manifest has these uses-permissions above the <application> tag:

    Code:
     <uses-permission  android:name="android.permission.ACCESS_COARSE_LOCATION"/>
        <uses-permission  android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.INTERNET"  />
    And again in the manifest I have

    Code:
    <uses-library android:name="com.google.android.maps"  />
    inside of the <application> tag.

    I got my API key correctly, I think my XML is ok, I imported everything correctly, I have the API checked in the project properties, and my Manifest looks good...

    Why does my app's MoreInfo Force Close on launch?
  2. Vmad
    Offline

    Vmad New Member

    Joined:
    Nov 22, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi UNEXPECTED62

    I am also having a similar issue ,
    Please let me know if you have figured out the problem or have a work around for that .

    --
    VMad
Search tags for this page

activity crashes when i relaunch on android

,
android app crashes when lanching google maps
,
android mapview crashes
,
google maps crashing upon launch
,
launch google maps activity from main
,

main activity button to google map

,
map activity keep crashing
,
mapactivity crashes
,
my second activity keeps crashing android