title: The method getFragmentManager() is undefined for the type
body: <p>I use Android API 19 and i want to pinpoint a location on my app, i can get location or see if GPS and Google play service is enable or not, no problem at those but when i want to show a map my problem begin.</p>
  
  <p>I found an tutorial that say use <strong>getFragmentManager</strong> can do this but Eclipse gave me this error:</p>
  
  <pre><code>The method getFragmentManager() is undefined for the type Mhelper
  </code></pre>
  
  <p>My class is :</p>
  
  <pre><code>package com.example.hach;
  
  import java.io.IOException;
  import java.util.List;
  import java.util.Locale;
  import java.util.concurrent.ExecutionException;
  
  //import com.example.hach.MainActivity.PlaceholderFragment;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.model.BitmapDescriptorFactory;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.Marker;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.GooglePlayServicesUtil;
  
  import android.support.v4.app.FragmentActivity;  
  import com.google.android.gms.maps.SupportMapFragment; 
  
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.content.ContentResolver;
  import android.content.Context;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.database.Cursor;
  import android.location.Address;
  import android.location.Geocoder;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.provider.ContactsContract;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import android.support.v4.app.* ;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v4.app.FragmentManager;
  
  public class Mhelper {
      static final LatLng HAMBURG = new LatLng(53.558, 9.927);
      static final LatLng KIEL = new LatLng(53.551, 9.993);
      private GoogleMap map;
  
      public void pinpointlocation(Context context){
  
           map = ((MapFragment) getFragmentManager().findFragmentById(R.id.mapview))
                      .getMap();
                  Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
                      .title("Hamburg"));
                  Marker kiel = map.addMarker(new MarkerOptions()
                      .position(KIEL)
                      .title("Kiel")
                      .snippet("Kiel is cool")
                      .icon(BitmapDescriptorFactory
                          .fromResource(R.drawable.ic_launcher)));
  
                  // Move the camera instantly to hamburg with a zoom of 15.
                  map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));
  
                  // Zoom in, animating the camera.
                  map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
      }
  ......
  </code></pre>
  
  <p>Then i search a little while and found a lot of offered solutions but non of them works for me and confused me more.</p>
  
  <p>One solution told to pass Contex to the function , but other solution told it is because we should build class extends from Fragment and then use this function , other said to put these imports:</p>
  
  <pre><code>import android.support.v4.app.* ;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v4.app.FragmentManager;
  </code></pre>
  
  <p>but same error, one of them suggest to use</p>
  
  <pre><code>((Activity)context).getFragmentManager()
  </code></pre>
  
  <p>but i get same error.</p>
  
  <p>Even i use <strong>getSupportFragmentManager()</strong> but same error.</p>
  
  <p>What should i do ? should i create a new class which extends from fragment ? is there any other simple way?</p>
  
  <p>PS: 
  I gave all sort of permissions in manifest xml and i put mapview on my layout xml and they gave me no error and i gave google api key for map,even it has nothing to do with this error.</p>