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.
Asked
Active
Viewed 897 times
1

Kristiyan Varbanov
- 2,439
- 2
- 17
- 37

Rozalia Al-Hourani
- 21
- 1
-
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 Answers
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
-
i added the fragment into the relative layout and i made a class for my fragment but i got alot of errors , am just a beginner at android please help me , – Rozalia Al-Hourani Mar 18 '16 at 09:52
-
-
make sure you've added this to your dependencies compile 'com.google.android.gms:play-services:7.5.0' – Sarah Maher Mar 20 '16 at 08:14