New Line character \n not displaying properly in textView Android

Viewed 37366

I know that if you do something like

myTextView.setText("This is on first line \n This is on second line");

Then it will display properly like this:

This is on first line
This is on second line

When I store that string in a database and then set it to the view it displays as such:

This is on first line \n This is on second line

Here is the line of code I use to extract the string from the database:

factView.setText(factsCursor.getString(MyDBAdapter.FACT_COLUMN));

I simply populate the database from a text file where each line is a new entry into the table so a line would look like this "This is on first line \n This is on second line" and it is stored as text.

Is there a reason that it isn't displaying the \n characters properly? It must be something to do with the string being in the database. Any suggestions?

5 Answers
Related