i try to use a mapview in my application to show a map but all i get is a grey grid something.
log cat shows this:
09-11 11:59:47.895: INFO/MapActivity(827): Handling network change notification:CONNECTED
09-11 11:59:48.005: INFO/InetAddress(827): Unknown host www.google.com, throwing UnknownHostException
.
.
.
repeating the unknown hos exception as long as the mapactivity is activ.
but using the google maps app AND internet on the emulator works just fine.
my xml file looks like that:
Using xml Syntax Highlighting
- <?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="i_use_my_debug_key_here"
- <LinearLayout
- android:id="@+id/zoomview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@id/mapview"
- android:layout_centerHorizontal="true"
- />
- </RelativeLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
and the java class:
Using java Syntax Highlighting
- package tab.tab;
- import com.google.android.maps.MapActivity;
- import com.google.android.maps.MapView;
- import android.app.Activity;
- import android.os.Bundle;
- import android.widget.LinearLayout;
- import android.widget.ZoomControls;
- public class Map extends MapActivity{
- private LinearLayout linlay;
- private MapView mapView;
- private ZoomControls mZoom;
- @Override
- protected boolean isRouteDisplayed(){
- return false;
- }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.maps);
- linlay = (LinearLayout) findViewById(R.id.zoomview);
- mapView = (MapView) findViewById(R.id.mapview);
- mZoom = (ZoomControls) mapView.getZoomControls();
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
i use the mapview inside of a tabview, but this should not be the problem.
sdk is 1.5. i also tried out the fingerprint code which i generated with my debug key. but all staid the same.(google maps works, mapview inside my application doesn't)
any sugesstions? thanks a lot!



