N
N
Nikolai2020-01-08 10:39:36
Android
Nikolai, 2020-01-08 10:39:36

Why does this open inside the app and not in the browser?

Hello. There is such a tricky code

if ((_url.startsWith("https://vk.com/")) || (_url.startsWith("https://www.facebook.com/"))){
          webview2.stopLoading();
          intent1.setData(Uri.parse(_url));
          intent1.setAction(Intent.ACTION_VIEW);
          startActivity(intent1);
        }

The application, in general, works (almost) without problems, but VK and Facebook continue to open inside the application, although the links (urls) definitely start with the specified ones. That is, the condition is 100% fulfilled. What is the problem?
There is also an inconvenience with t.me. As you know, this is a url, by opening which in ACTION_VIEW you can immediately go to the telegram application. But this selection window makes you wait 20-30 seconds. Are there any tricks needed or am I doing something wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question