sirjo66 Well-Known Member Licensed User Longtime User Mar 13, 2015 #1 Hello, I have a file .html that I want to view with default html viewer. I use this code but it don't works: Code: Copy 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. Do I need to use Intent.SetComponent ?? Sergio Last edited: Mar 13, 2015
Hello, I have a file .html that I want to view with default html viewer. I use this code but it don't works: Code: Copy 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. Do I need to use Intent.SetComponent ?? Sergio
Mark Read Well-Known Member Licensed User Longtime User Mar 13, 2015 #2 What about using the default editor? Code: Copy Dim ii AsIntent ii.Initialize(ii.ACTION_EDIT, "file://" & File.Combine(File.DirDefaultExternal, "guia.htm")) ii.SetType("text/html") StartActivity(ii) Upvote 0
What about using the default editor? Code: Copy Dim ii AsIntent ii.Initialize(ii.ACTION_EDIT, "file://" & File.Combine(File.DirDefaultExternal, "guia.htm")) ii.SetType("text/html") StartActivity(ii)
sirjo66 Well-Known Member Licensed User Longtime User Mar 13, 2015 #3 No EDIT, I want to VIEW it Upvote 0
NJDude Expert Licensed User Longtime User Mar 13, 2015 #4 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. Upvote 0
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.
sirjo66 Well-Known Member Licensed User Longtime User Mar 14, 2015 #5 SOLVED !! Code: Copy Dim ii As Intent ii.Initialize(ii.ACTION_VIEW, "file://" & File.Combine(File.DirDefaultExternal, "guia.htm")) ii.SetType("application/x-webarchive-xml") StartActivity(ii) Upvote 0
SOLVED !! Code: Copy Dim ii As Intent ii.Initialize(ii.ACTION_VIEW, "file://" & File.Combine(File.DirDefaultExternal, "guia.htm")) ii.SetType("application/x-webarchive-xml") StartActivity(ii)
NJDude Expert Licensed User Longtime User Mar 14, 2015 #6 Like I mentioned on my previous post, better let the user choose, your solution doesn't work on all devices. Upvote 0
Like I mentioned on my previous post, better let the user choose, your solution doesn't work on all devices.