How to open an URL from code in the built-in web browser rather than within my application?
I tried this:
try {
Intent myIntent = new Intent(Int
Chrome custom tabs are now available:
The first step is adding the Custom Tabs Support Library to your build.gradle file:
dependencies {
...
compile 'com.android.support:customtabs:24.2.0'
}
And then, to open a chrome custom tab:
String url = "https://www.google.pt/";
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse(url));
For more info: https://developer.chrome.com/multidevice/android/customtabs