title: How to retrieve current device location & show it on map fragment in a fragment
body: <p>I'm developing a android app with google maps. Currently I'm able to view the map inside my app, but I don't know how to view the current location on the app.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class MapsFragment extends Fragment{
          MapView m;
  
          @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container, 
                  Bundle savedInstanceState) {
              // inflat and return the layout
              View v = inflater.inflate(R.layout.map_near_me, container, false);
              m = (MapView) v.findViewById(R.id.map);
              m.onCreate(savedInstanceState);
              return v;
          }
  }
  </code></pre>
  
  <p><strong>Edited:</strong>
  And the xml:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;com.google.android.gms.maps.MapView
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:id="@+id/map" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This code works fine and I got to know 'setmylocationenabled' can help to enable in FragmentActivity, but unfortunately I have to use the type as 'Fragment'. And I'm using google api v2. Please someone help with this.</p>