I’m doing my GPS app. Standalone app with GoogleMaps works smoothly (map intent is easy to invoke). I tried integrating it my core app (which has several other intents) and I’m having problem launching it.
I’ve tried this:
public class MapaG extends Activity {
public class MapaG1 extends MapActivity {
private static final int latitudeE6= 50656428;
private static final int longitudeE6 = 17899562;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.widokmapy);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = this.getResources().getDrawable(R.drawable.icon);
NakladkaNaMape itemizedOverlay = new NakladkaNaMape(drawable, this);
GeoPoint point = new GeoPoint(latitudeE6, longitudeE6);
OverlayItem overlayitem = new OverlayItem(point, "Witaj w Opolu", "Polska");
itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
MapController mapController = mapView.getController();
mapController.animateTo(point);
mapController.setZoom(12);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
}
LogCat perspective gives me info that no Activity was found:
FATAL EXEPTION: main android.content.ActivityNotFoundException: No Activity found handle Intent {act=praca.dyp.k.d.MAPAG}
I’m wondering why you are creating a MapActivity class inside an Activity? Remove the outer activity class declaration. Keep the MapActivity class. Use proper permissions in Manifest.