D
D
DenchikHonorm2018-08-07 19:59:52
Mobile development
DenchikHonorm, 2018-08-07 19:59:52

How to make a redirect from the application to the site open in the browser, and not in the application itself?

There is an application in the Google Playmarket, it is essentially a browser for the site, this site has a redirect to another site, you need this other site to open in another browser, for example, in Chrome, because at the moment it opens, as it were, anyway within the application. How can this be implemented? Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Chvarkov, 2018-08-08
@KuSu

You must create an intent to open the site and let the system process it

String url = "http://www.google.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
or in one line
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question