Search code examples
androidandroid-studio

Is there a way to open a link in a browser window?


I currently use this

Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse("https://www.google.com"));
startActivity(intent); 

It currently opens in my default browser.

But I need it to open like this.

Is there any simple way to do that?


Solution

  • You can do this with custom tabs: https://developer.chrome.com/docs/android/custom-tabs/guide-get-started