L lip Active Member Licensed User Longtime User Apr 11, 2014 #1 Hopefully a simple one: I am writing a log file (log.txt) into File.DirDefaultExternal I can use File Viewer to see the file. It opens on my Tablet in Polaris Office. I am now trying to make a Button to open the file. Ideally This should not specifically use Polaris as other users will have different text file viewers. I have been trying to use Intent with .Initialize2(File.DirDefaultExternal & "/log.txt") without success. Is this the right approach?
Hopefully a simple one: I am writing a log file (log.txt) into File.DirDefaultExternal I can use File Viewer to see the file. It opens on my Tablet in Polaris Office. I am now trying to make a Button to open the file. Ideally This should not specifically use Polaris as other users will have different text file viewers. I have been trying to use Intent with .Initialize2(File.DirDefaultExternal & "/log.txt") without success. Is this the right approach?
NJDude Expert Licensed User Longtime User Apr 11, 2014 #2 Try this: Code: Copy myFile = File.Combine(File.DirDefaultExternal, "Log.txt") Dim i As Intent i.Initialize(i.ACTION_VIEW, myFile) i.SetType("text/plain") StartActivity(i) Upvote 0
Try this: Code: Copy myFile = File.Combine(File.DirDefaultExternal, "Log.txt") Dim i As Intent i.Initialize(i.ACTION_VIEW, myFile) i.SetType("text/plain") StartActivity(i)
L lip Active Member Licensed User Longtime User Apr 13, 2014 #3 NJDude said: Try this: Code: Copy myFile = File.Combine(File.DirDefaultExternal, "Log.txt") Dim i As Intent i.Initialize(i.ACTION_VIEW, myFile) i.SetType("text/plain") StartActivity(i) Click to expand... Thanks - this looks logical, but when I tried it (only change was Dim myFile as String at the top) I get a message "Not a supported Document Type" Upvote 0
NJDude said: Try this: Code: Copy myFile = File.Combine(File.DirDefaultExternal, "Log.txt") Dim i As Intent i.Initialize(i.ACTION_VIEW, myFile) i.SetType("text/plain") StartActivity(i) Click to expand... Thanks - this looks logical, but when I tried it (only change was Dim myFile as String at the top) I get a message "Not a supported Document Type"
NJDude Expert Licensed User Longtime User Apr 13, 2014 #4 I don't have Polaris installed, but the code works and the text editor opens the file without a problem. Upvote 0
I don't have Polaris installed, but the code works and the text editor opens the file without a problem.