Map activity crashes on launch!

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Map activity crashes on launch!

Postby st_141 » Tue Oct 19, 2010 7:13 am

My Map activity crashes on launch. I have included all the permission and also tested on a new standalone map project where it worked perfectly well with the underlying code. Rather when I incorporate the same code in my application, it crashes as soon as this activity is invoked. I have a project submission tomorrow morning, so please reply asap


My map activity is as follows
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.healthcare.iFind;
  2.  
  3. import com.google.android.maps.MapActivity;
  4. import com.google.android.maps.MapView;
  5. import com.google.android.maps.MapView.LayoutParams;
  6.  
  7. import android.os.Bundle;
  8. import android.view.View;
  9. import android.widget.LinearLayout;
  10.  
  11. public class MapsActivity extends MapActivity
  12. {
  13. MapView mapView;
  14.  
  15. /** Called when the activity is first created. */
  16. @Override
  17. public void onCreate(Bundle savedInstanceState)
  18. {
  19. super.onCreate(savedInstanceState);
  20. setContentView(R.layout.maps);
  21.  
  22.  
  23. mapView = (MapView) findViewById(R.id.mapView);
  24. LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);
  25. View zoomView = mapView.getZoomControls();
  26.  
  27. zoomLayout.addView(zoomView,
  28. new LinearLayout.LayoutParams(
  29. LayoutParams.WRAP_CONTENT,
  30. LayoutParams.WRAP_CONTENT));
  31. mapView.displayZoomControls(true);
  32.  
  33. }
  34.  
  35. @Override
  36. protected boolean isRouteDisplayed() {
  37. // TODO Auto-generated method stub
  38. return false;
  39. }
  40. }
  41.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


My AndroidManifest.xml file:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3. package="com.healthcare.iFind"
  4. android:versionCode="1"
  5. android:versionName="1.0.0">
  6. <application android:icon="@drawable/icon" android:label="@string/app_name">
  7. <uses-library android:name="com.google.android.maps" />
  8. <activity android:name=".HomeScreen"
  9. android:label="@string/app_name">
  10. <intent-filter>
  11. <action android:name="android.intent.action.MAIN" />
  12. <category android:name="android.intent.category.LAUNCHER" />
  13. </intent-filter>
  14. </activity>
  15. <activity android:name="MessageList"></activity>
  16. <activity android:name="RateDoctor"></activity>
  17. <activity android:name="RateQuiz"></activity>
  18. <activity android:name="DetailedDoctor"></activity>
  19. <activity android:name="DoctorProfile"></activity>
  20. <activity android:name=".MapsActivity"/>
  21. </application>
  22.  
  23. My maplayout .xml file.
  24. <uses-permission android:name="android.permission.INTERNET" />
  25. <uses-permission android:name="android.permission.CALL_PHONE" />
  26.  
  27. </manifest>
Parsed in 0.005 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="fill_parent">
  5.  
  6. <com.google.android.maps.MapView
  7. android:id="@+id/mapView"
  8. android:layout_width="fill_parent"
  9. android:layout_height="fill_parent"
  10. android:enabled="true"
  11. android:clickable="true"
  12. android:apiKey="mykey"
  13. />
  14. <LinearLayout android:id="@+id/zoom"
  15. android:layout_width="wrap_content"
  16. android:layout_height="wrap_content"
  17. android:layout_alignParentBottom="true"
  18. android:layout_centerHorizontal="true"
  19. />
  20.  
  21. </RelativeLayout>
  22.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


My app crashes as soon as I launch this activity.

Please help me figure out the problem. I use Google API with Android 2.2 in Eclipse.

Also do let me know if we can geocode in google maps only using a given zipcode and address and no lat and long values.

Thanks in advance :)
st_141
Freshman
Freshman
 
Posts: 4
Joined: Wed Oct 06, 2010 1:27 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 4 guests