Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogleMap class object throw Nullpointer Exception
    primarykey
    data
    text
    <p>friends, I am getting NullPointer error ,on <strong>addMarker()</strong></p> <p>Below is my sample code.</p> <pre><code>GoogleMap myMap; android.support.v4.app.FragmentManager myFragmentManager = getSupportFragmentManager(); SupportMapFragment myMapFragment = (SupportMapFragment)myFragmentManager.findFragmentById(R.id.map); myMap = myMapFragment.getMap(); myMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker")); myMap.setMyLocationEnabled(true); myMap.getUiSettings().setZoomControlsEnabled(true); myMap.getUiSettings().setCompassEnabled(true); myMap.getUiSettings().setMyLocationButtonEnabled(true); </code></pre> <p>Error message like NullPointer at line </p> <pre><code>myMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker")); </code></pre> <p><strong>main.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".DemoMapActiviy" &gt; &lt;TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>any idea how can i solve it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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