I created following xml layout file to use a MapView class:
*******************************************************************************************
XML LAYOUT FILE
*******************************************************************************************
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:id="@+id/main"
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:enabled="true"
android:clickable="true"
android:apiKey="@string/maps_api_key"
/>
</RelativeLayout>
*******************************************************************************************
When I tried to generate an instance of MapView with (MapView)
findViewById(R.id.mapview), it returns NULL.
This is my script:
*******************************************************************************************
IN SCRIPT FILE...
*******************************************************************************************
private void initMapView()
{
map = (MapView) findViewById(R.id.mapview); // here
returns
null....
controller = map.getController();
map.setSatellite(true);
map.setBuiltInZoomControls(true);
}
*******************************************************************************************
please some help,
thanks...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en