I want to write a number of html files on my PC. I then want these files bundled into my app installable, so when the app is installed on the smart phone, it already has these files stored locally. I then want to use a button in my existing app to select 1 of these files and then to have this file opened up for viewing in a separate web browser (outside of my app). I have tried using code like this below and it works fine for running html pages from external sites:
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"))
startActivity(browserIntent)
However if I try and publish from a file on my Android like Uri.parse("file://android_assets/test.htm") then my app crashes. Can anyone suggest how I can publish html files from my Android app in a new browser, I would prefer to use something like Intent ACTION_VIEW? I have this working with webview but loading the html page inside the app really degrades the user experience.