How to use MapBox NavigationView inside a fragment











up vote
2
down vote

favorite












Based on the changes that has been introduced in 0.7.0, I need to make use of turn-by-turn navigation drop-in UI, however inside my fragment, so I need help trying to figure out how to do so as the documentation to implement NavigationView is based on Activity, such as the life cycle callbacks which are different in the case of fragments



The reason why I need to make use of the drop-in UI inside my fragment is because my fragment is in a tab control, and is already handling some custom location based features, and needs to show a turn-by-turn navigation when needed










share|improve this question




























    up vote
    2
    down vote

    favorite












    Based on the changes that has been introduced in 0.7.0, I need to make use of turn-by-turn navigation drop-in UI, however inside my fragment, so I need help trying to figure out how to do so as the documentation to implement NavigationView is based on Activity, such as the life cycle callbacks which are different in the case of fragments



    The reason why I need to make use of the drop-in UI inside my fragment is because my fragment is in a tab control, and is already handling some custom location based features, and needs to show a turn-by-turn navigation when needed










    share|improve this question


























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Based on the changes that has been introduced in 0.7.0, I need to make use of turn-by-turn navigation drop-in UI, however inside my fragment, so I need help trying to figure out how to do so as the documentation to implement NavigationView is based on Activity, such as the life cycle callbacks which are different in the case of fragments



      The reason why I need to make use of the drop-in UI inside my fragment is because my fragment is in a tab control, and is already handling some custom location based features, and needs to show a turn-by-turn navigation when needed










      share|improve this question















      Based on the changes that has been introduced in 0.7.0, I need to make use of turn-by-turn navigation drop-in UI, however inside my fragment, so I need help trying to figure out how to do so as the documentation to implement NavigationView is based on Activity, such as the life cycle callbacks which are different in the case of fragments



      The reason why I need to make use of the drop-in UI inside my fragment is because my fragment is in a tab control, and is already handling some custom location based features, and needs to show a turn-by-turn navigation when needed







      android mapbox mapbox-android






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '17 at 22:03

























      asked Nov 16 '17 at 21:55









      Azhar Ali

      266111




      266111
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          You can either use the NavigationLauncher, which will create its own full screen activity on the fly, or you can create your own NavigationView fragment. I preferred the latter option, as then, I could embed the fragment into my tabbed container.



          The full instructions are located here.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47339773%2fhow-to-use-mapbox-navigationview-inside-a-fragment%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            You can either use the NavigationLauncher, which will create its own full screen activity on the fly, or you can create your own NavigationView fragment. I preferred the latter option, as then, I could embed the fragment into my tabbed container.



            The full instructions are located here.






            share|improve this answer

























              up vote
              0
              down vote













              You can either use the NavigationLauncher, which will create its own full screen activity on the fly, or you can create your own NavigationView fragment. I preferred the latter option, as then, I could embed the fragment into my tabbed container.



              The full instructions are located here.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                You can either use the NavigationLauncher, which will create its own full screen activity on the fly, or you can create your own NavigationView fragment. I preferred the latter option, as then, I could embed the fragment into my tabbed container.



                The full instructions are located here.






                share|improve this answer












                You can either use the NavigationLauncher, which will create its own full screen activity on the fly, or you can create your own NavigationView fragment. I preferred the latter option, as then, I could embed the fragment into my tabbed container.



                The full instructions are located here.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 29 at 18:34









                Mr L

                518




                518






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47339773%2fhow-to-use-mapbox-navigationview-inside-a-fragment%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Coverage of Google Street View

                    Full-time equivalent

                    Surfing