Skip to content Skip to sidebar Skip to footer

How To Use Maps Fragment In Navigation Drawer?

how to use fragment maps in navigation drawer? I am trying to use but the error, so I possessed three chronological list that contains the display maps, I created two more yet or i

Solution 1:

You could try calling a method like OpenMap() from your navigation drawer in this section, where the method is located in your main activity with the following code:

public void onSectionAttached(int number) {
        switch (number) {
            case 1:
                mTitle = getString(R.string.title_section1);
                OpenMap();
                break;




private void openMap() {
        double latitude = 32.715000;
        double longitude = -117.162500;
        String label = "Starting point";
        String uriBegin = "geo:" + latitude + "," + longitude;
        String query = latitude + "," + longitude + "(" + label + ")";
        String encodedQuery = Uri.encode(query);
        String uriString = uriBegin + "?q=" + encodedQuery + "&z=16";
        Uri uri = Uri.parse(uriString);
        Intent intent = new Intent(android.content.Intent.ACTION_VIEW, uri);
        startActivity(intent);

Post a Comment for "How To Use Maps Fragment In Navigation Drawer?"