In my app i showing google map version2 in a fragment. but i get Null pointer exception at
mMap = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
if(map != null) {
mMap.addMarker(new MarkerOptions() .position(new LatLng(xxxxxx,xxxxxx)) .title("Current Location")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ball_pointer))
.snippet("xxxxx"));
}
place your google api key here. You get from google Read the documentation.