Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay Google Map in Android Emulator
    text
    copied!<p>im trying to use google Map in my android application. </p> <p>I have added two permission for user :INTERNET and ACCESS_FINE_LOCATION" and also : "uses-library android:name="com.google.android.maps" here is my activity for showing the map:</p> <pre><code>public class SportEventActivity extends MapActivity { private MapController mapController; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sportevent); Bundle extras = getIntent().getExtras(); if (extras != null) { // Reads the parameters to this view String sportName = extras.getString(Utility.SPORT_NAME); String venueName = extras.getString(Utility.VENUE_NAME); String startDate = extras.getString(Utility.START_DATE); String endDate = extras.getString(Utility.END_DATE); final String latitude = extras.getString(Utility.LATITUDE); final String longitude = extras.getString(Utility.LONGITUDE); TextView text1 = (TextView) findViewById(R.id.sedSportName); text1.setText("Sport: " + sportName); TextView text2 = (TextView) findViewById(R.id.sedVenue); text2.setText("Venue: " + venueName); TextView text3 = (TextView) findViewById(R.id.sedStartDate); text3.setText("Start date: " + startDate); TextView text4 = (TextView) findViewById(R.id.sedEndDate); text4.setText("End date: " + endDate); MapView mapView = (MapView) findViewById(R.id.mapview2); mapView.setBuiltInZoomControls(true); mapView.setStreetView(true); this.mapController = mapView.getController(); this.mapController.setZoom(16); Double lat = getCoordinate(latitude) * 1E6; Double lng = getCoordinate(longitude) * 1E6; mapController.setCenter(new GeoPoint(lat.intValue(), lng.intValue())); } } @Override protected boolean isRouteDisplayed() { return false; } private Double getCoordinate(String coordinate) { return Double.parseDouble(coordinate); } } </code></pre> <p>and also you can find the layout code related to this activity :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1" android:id="@+id/sedLayout"&gt; &lt;TableRow&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView android:layout_column="1" android:padding="3dip" android:text="Sport name" android:id="@+id/sedSportName" /&gt; &lt;TextView android:gravity="right" android:padding="3dip" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView android:layout_column="1" android:padding="3dip" android:text="Venue" android:id="@+id/sedVenue" /&gt; &lt;TextView android:gravity="right" android:padding="3dip" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView android:padding="3dip" /&gt; &lt;TextView android:padding="3dip" android:text="Start Date" android:id="@+id/sedStartDate" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView android:padding="3dip" /&gt; &lt;TextView android:padding="3dip" android:text="End Date" android:id="@+id/sedEndDate" /&gt; &lt;TextView android:gravity="right" android:padding="3dip" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView android:padding="3dip" /&gt; &lt;View android:layout_height="2dip" android:background="#FF909090" /&gt; &lt;TextView android:padding="3dip" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;/TableRow&gt; &lt;com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="0aULnfycQonb-l_B1QlcK8u4POo4_oKjnmqMU1Q" /&gt; &lt;/TableLayout&gt; </code></pre> <p>I can see the map, but the problem is that when I see the map, it show one chess chart on the map. I have attached a screenshot form the result. if any body why it show me the map with a borders, please give me a solution.</p> <p><img src="https://i.stack.imgur.com/55fOX.png" alt="here is the screen shot of "></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload