title: Get current Location automatically on opening up the app
body: <p>I'm unable to get my current location on the Google Maps Activity, I've made sure the permissions are implemented in the Android Manifest, but it still goes to 0,0 instead of my current location. On the emulator, the Location preferences are set to on.</p>
  
  <p>This is my Main Activity:</p>
  
  <pre><code>import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  public class RainstormMap extends FragmentActivity {
  
  private GoogleMap mMap; 
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_rainstorm_map);
      setUpMapIfNeeded();
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      setUpMapIfNeeded();
  }
  
  
  private void setUpMapIfNeeded() {
  
      if (mMap == null) {
          // Try to obtain the map from the SupportMapFragment.
          mMap = ((SupportMapFragment)              getSupportFragmentManager().findFragmentById(R.id.map))
                  .getMap();
          // Check if we were successful in obtaining the map.
          if (mMap != null) {
              setUpMap();
          }
      }
  }
  
  /**
   * This is where we can add markers or lines, add listeners or move the camera. In this case, we
   * just add a marker near Africa.
   * &lt;p/&gt;
   * This should only be called once and when we are sure that {@link #mMap} is not null.
   */
  private void setUpMap() {
      mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
  }
  </code></pre>