android - MapView isn't showing up with this? -



android - MapView isn't showing up with this? -

i have layout in xml. , when run activity @ bottom nil shows except buttons.

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="fill_parent"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:orientation="horizontal" android:layout_height="fill_parent"> <button android:id="@+id/sat" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="satellite" android:onclick="myclickhandler" android:padding="8px"/> <button android:id="@+id/street" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="street" android:onclick="myclickhandler" android:padding="8px"/> <button android:id="@+id/traffic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="traffic" android:onclick="myclickhandler" android:padding="8px"/> <button android:id="@+id/normal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="normal" android:onclick="myclickhandler" android:padding="8px"/> </linearlayout> <com.google.android.maps.mapview android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:clickable="true" android:apikey= /> </linearlayout>

for reason thingi can see buttons @ top. map doesn't show when activity ran.

here code in mapactivity also.

public class meeting_map extends mapactivity{ private mapview mapview; @override protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.mapview); mapview = (mapview)findviewbyid(r.id.mapview); mapview.setbuiltinzoomcontrols(true); } public void myclickhandler(view target){ switch(target.getid()){ case r.id.sat: mapview.setsatellite(true); break; case r.id.street: mapview.setstreetview(true); break; case r.id.traffic: mapview.settraffic(true); break; case r.id.normal: mapview.setsatellite(false); mapview.settraffic(false); mapview.setstreetview(false); break; } } @override protected boolean islocationdisplayed(){ homecoming false; } @override protected boolean isroutedisplayed() { // todo auto-generated method stub homecoming false; } }

maybe i'm missing something.

if alter android:layout_height="fill_parent" of 2nd linearlayout android:layout_height="wrap_content" , android:layout_height="wrap_content" of mapview android:layout_height="fill_parent" should work (assuming have valid api key + android.permission.internet set in androidmanifest.xml file).

android google-maps

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -