Android Question BBCodeView or EditText ?

js486dog

Active Member
Licensed User
I need to open and read txt files.
I can use EditText or BBCodeView.

I think there is some disadvantage for BBCodeView:

TXT files has to be as has to be for BBCodeView.
EditText is more freely for content of files.

Look:
from1.txt - bad file for BBCodeView.
from2.txt - good file for BBCodeView.

Look also attached project.
 

Attachments

emexes

Well-Known Member
Licensed User
You can wrap the text with the plain tag and it will not be parsed.
Eg, read file from1.txt into a string, and then add the tags like:
B4X:
Dim PlainString As String = "[PLAIN]" & WholeFileString & "[/PLAIN]"
so that PlainString would then be:

[PLAIN]EditText works fine with this text and text […] as this.
But BBCodeView has problem.[/PLAIN]
 

js486dog

Active Member
Licensed User
Eg, read file from1.txt into a string, and then add the tags like:
B4X:
Dim PlainString As String = "[PLAIN]" & WholeFileString & "[/PLAIN]"
so that PlainString would then be:

[PLAIN]EditText works fine with this text and text […] as this.
But BBCodeView has problem.[/PLAIN]
Thank you very much "emexes".
That's right. This code read txt files as plain files - not as code files.
I think I have to correct my first post about the disadvantage for BBCodeView.
 
Top