How can I make internal links load within webview?How do I generate random integers within a specific range in Java?How can I create an executable JAR with dependencies using Maven?How can I convert a stack trace to a string?Why is the Android emulator so slow? How can we speed up the Android emulator?How do I make links in a TextView clickable?How to get Webview iframe link to launch the browser?Android - webview - shouldOverrideUrlLoading not called - when user clicks links inside iframeError message -> shouldOverrideUrlLoading Webview AndroidShow PDF file in AppIs default behavior of Android's WebView changed to open internally all links?

Does the "6 seconds per round" rule apply to speaking/roleplaying during combat situations?

Remove sudoers using script

Why don't B747s start takeoffs with full throttle?

Strange symbol for two functions

What is this solid state starting relay component?

What can plausibly explain many of my very long and low-tech bridges?

How can you travel on a trans-Siberian train when it is fully booked?

Where does this pattern of naming products come from?

Building a road to escape Earth's gravity by making a pyramid on Antartica

What happens when the attacking player dies to damage triggers after killing the blocking creatures in the first combat step of double strike?

Random Portfolios vs Efficient Frontier

Payment instructions from HomeAway look fishy to me

Do any instruments not produce overtones?

Should an arbiter claim draw at a K+R vs K+R endgame?

What risks are there when you clear your cookies instead of logging off?

PL/SQL function to receive a number and return its binary format

My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?

How is it possible that Gollum speaks Westron?

Do the English have an ancient (obsolete) verb for the action of the book opening?

Question about JavaScript Math.random() and basic logic

Translating 'Liber'

What's the right way to purge recursively with apt?

What does the "c." listed under weapon length mean?

2.8 is missing the Carve option in the Boolean Modifier



How can I make internal links load within webview?


How do I generate random integers within a specific range in Java?How can I create an executable JAR with dependencies using Maven?How can I convert a stack trace to a string?Why is the Android emulator so slow? How can we speed up the Android emulator?How do I make links in a TextView clickable?How to get Webview iframe link to launch the browser?Android - webview - shouldOverrideUrlLoading not called - when user clicks links inside iframeError message -> shouldOverrideUrlLoading Webview AndroidShow PDF file in AppIs default behavior of Android's WebView changed to open internally all links?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am having issues with trying to get internal links to open within my webview-based android client that I am doing for a small business. What do I need to do so that the application can only open links with "https://forums.mywebsite.com" and "https://mywebsite.com"?



I already have the procedure I need to open external links using the action view, but this only links away from the first page that is stated in the loadurl(), and does not link them within the client, and treats them as external links.



aWebView.setWebViewClient(new WebViewClient() 
@Override
@TargetApi(21)
public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());

superWebView.getContext().startActivity(intent);

return true;

);


TL;DR: link expectations are not working, and any help would be appreciated.










share|improve this question






























    1















    I am having issues with trying to get internal links to open within my webview-based android client that I am doing for a small business. What do I need to do so that the application can only open links with "https://forums.mywebsite.com" and "https://mywebsite.com"?



    I already have the procedure I need to open external links using the action view, but this only links away from the first page that is stated in the loadurl(), and does not link them within the client, and treats them as external links.



    aWebView.setWebViewClient(new WebViewClient() 
    @Override
    @TargetApi(21)
    public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
    Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());

    superWebView.getContext().startActivity(intent);

    return true;

    );


    TL;DR: link expectations are not working, and any help would be appreciated.










    share|improve this question


























      1












      1








      1








      I am having issues with trying to get internal links to open within my webview-based android client that I am doing for a small business. What do I need to do so that the application can only open links with "https://forums.mywebsite.com" and "https://mywebsite.com"?



      I already have the procedure I need to open external links using the action view, but this only links away from the first page that is stated in the loadurl(), and does not link them within the client, and treats them as external links.



      aWebView.setWebViewClient(new WebViewClient() 
      @Override
      @TargetApi(21)
      public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
      Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());

      superWebView.getContext().startActivity(intent);

      return true;

      );


      TL;DR: link expectations are not working, and any help would be appreciated.










      share|improve this question
















      I am having issues with trying to get internal links to open within my webview-based android client that I am doing for a small business. What do I need to do so that the application can only open links with "https://forums.mywebsite.com" and "https://mywebsite.com"?



      I already have the procedure I need to open external links using the action view, but this only links away from the first page that is stated in the loadurl(), and does not link them within the client, and treats them as external links.



      aWebView.setWebViewClient(new WebViewClient() 
      @Override
      @TargetApi(21)
      public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
      Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());

      superWebView.getContext().startActivity(intent);

      return true;

      );


      TL;DR: link expectations are not working, and any help would be appreciated.







      java android






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 15:34









      Zoe

      15.1k85789




      15.1k85789










      asked Mar 24 at 15:34









      Androidguy1Androidguy1

      61




      61






















          1 Answer
          1






          active

          oldest

          votes


















          1














          As the docs explains:




          returning true causes the current WebView to abort loading the URL, while returning false causes the WebView to continue loading the URL as usual.




          You should have logic in the method that checks the URL and returns false only if the url matches your expected URLs and starts the activity and return true otherwise.



          Something along those lines:



           WebView.setWebViewClient(new WebViewClient() 
          @Override
          @TargetApi(21)
          public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
          );





          share|improve this answer

























          • Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

            – Androidguy1
            Mar 24 at 22:10











          • Edited the answer to add an example

            – Mohamed Abdalkader
            Mar 26 at 3:25











          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',
          autoActivateHeartbeat: false,
          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%2f55325439%2fhow-can-i-make-internal-links-load-within-webview%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









          1














          As the docs explains:




          returning true causes the current WebView to abort loading the URL, while returning false causes the WebView to continue loading the URL as usual.




          You should have logic in the method that checks the URL and returns false only if the url matches your expected URLs and starts the activity and return true otherwise.



          Something along those lines:



           WebView.setWebViewClient(new WebViewClient() 
          @Override
          @TargetApi(21)
          public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
          );





          share|improve this answer

























          • Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

            – Androidguy1
            Mar 24 at 22:10











          • Edited the answer to add an example

            – Mohamed Abdalkader
            Mar 26 at 3:25















          1














          As the docs explains:




          returning true causes the current WebView to abort loading the URL, while returning false causes the WebView to continue loading the URL as usual.




          You should have logic in the method that checks the URL and returns false only if the url matches your expected URLs and starts the activity and return true otherwise.



          Something along those lines:



           WebView.setWebViewClient(new WebViewClient() 
          @Override
          @TargetApi(21)
          public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
          );





          share|improve this answer

























          • Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

            – Androidguy1
            Mar 24 at 22:10











          • Edited the answer to add an example

            – Mohamed Abdalkader
            Mar 26 at 3:25













          1












          1








          1







          As the docs explains:




          returning true causes the current WebView to abort loading the URL, while returning false causes the WebView to continue loading the URL as usual.




          You should have logic in the method that checks the URL and returns false only if the url matches your expected URLs and starts the activity and return true otherwise.



          Something along those lines:



           WebView.setWebViewClient(new WebViewClient() 
          @Override
          @TargetApi(21)
          public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
          );





          share|improve this answer















          As the docs explains:




          returning true causes the current WebView to abort loading the URL, while returning false causes the WebView to continue loading the URL as usual.




          You should have logic in the method that checks the URL and returns false only if the url matches your expected URLs and starts the activity and return true otherwise.



          Something along those lines:



           WebView.setWebViewClient(new WebViewClient() 
          @Override
          @TargetApi(21)
          public boolean shouldOverrideUrlLoading(WebView aWebView, WebResourceRequest request)
          );






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 26 at 3:25

























          answered Mar 24 at 20:24









          Mohamed AbdalkaderMohamed Abdalkader

          251136




          251136












          • Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

            – Androidguy1
            Mar 24 at 22:10











          • Edited the answer to add an example

            – Mohamed Abdalkader
            Mar 26 at 3:25

















          • Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

            – Androidguy1
            Mar 24 at 22:10











          • Edited the answer to add an example

            – Mohamed Abdalkader
            Mar 26 at 3:25
















          Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

          – Androidguy1
          Mar 24 at 22:10





          Can you provide an example of this? The only documentation I was able to find was for api versions prior to api 24, and do not work in the SDK that I am using.

          – Androidguy1
          Mar 24 at 22:10













          Edited the answer to add an example

          – Mohamed Abdalkader
          Mar 26 at 3:25





          Edited the answer to add an example

          – Mohamed Abdalkader
          Mar 26 at 3:25



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325439%2fhow-can-i-make-internal-links-load-within-webview%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript