1

I have created a navigation drawer activity and a map activity . Is it possible to make the map appears with a navigation drawer? . If you couldn't understand what i am saying , please search for here maps in the Google Play, they have the same idea that i want to create.

Kristiyan Varbanov
  • 2,439
  • 2
  • 17
  • 37
  • If you want to draw driver directions on map, probably there you will find solutions for your problems: http://stackoverflow.com/questions/14702621/answer-draw-path-between-two-points-using-google-maps-android-api-v2 http://javapapers.com/android/draw-path-on-google-maps-android-api/ http://stackoverflow.com/questions/17425499/how-to-draw-interactive-polyline-on-route-google-maps-v2-android http://blog-emildesign.rhcloud.com/?p=822 – Szamot Mar 16 '16 at 12:51

1 Answers1

0

use this tetorial to make the navigation drawer : Navigation Drawer

then create a fragment for your map with this in the xml :

   <fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment" />

(inside the relative Layout of course)

add a class for your fragment as

    public class YourFragmentName extends Fragment {
        @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
            Your_Parent_Activity = super.getActivity();
            //Initiate Context

Your_Fragment_Layout = (RelativeLayout)inflater.inflate(R.layout.activity_YourXmlLayout, container, false);

 map = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map)).getMap();
  return Your_Fragment_Layout;
}
Sarah Maher
  • 790
  • 1
  • 10
  • 21