Preview HTML file in Android Studio plugin

762 Views Asked by At

I'm creating Android Studio plugin and I need to open (preview) html file. For now I can open HTML file using this code:

String file="c:\\test\\index.html";    
BrowserLauncher.getInstance().browse(file,WebBrowserManager.getInstance().getFirstActiveBrowser());

The problem is that this code open external webbrowser. But I would like to open this HTML file inside Android Studio (IntelliJ) IDE (open a new tab with HTML preview).

How can I do this?

1

There are 1 best solutions below

0
On

Use Open In > Browser > Built-in Preview

enter image description here

It opens new tab in Android Studio