I have a file .html that I want to view with default html viewer.
I use this code but it don't works:
B4X:
Dim ii As Intent
ii.Initialize(ii.ACTION_VIEW, "file://" & File.Combine(File.DirDefaultExternal, "guia.htm"))
ii.SetType("text/html")
StartActivity(ii)
Android ask to me for to select the program that I want to use, but there are only "DB editor" and "HTMLViewer" but don't open default viewer.
That means there's no default viewer assigned, the user should choose which one to use. Using SetComponent might fail on some devices, they might not have the viewer you indicate.
Dim ii As Intent
ii.Initialize(ii.ACTION_VIEW, "file://" & File.Combine(File.DirDefaultExternal, "guia.htm"))
ii.SetType("application/x-webarchive-xml")
StartActivity(ii)