title: Android textview not supporting line break
body: <p>I'm creating a custom view programmatically that is displaying text that is parsed from an XML file.  The text is long and contains the "/n" character for force line breaks.  For some reason, the text view is displaying the /n and there isn't any line breaks.  Here is my code:</p>
  
  <pre><code>                    // get the first section body
                      Object body1 = tempDict.get("FIRE");
                      String fireText = body1.toString();
  
                      // create the section body
                      TextView fireBody = new TextView(getActivity());
                      fireBody.setTextColor(getResources().getColor(R.color.black));
                      fireBody.setText(fireText);
                      fireBody.setTextSize(14);
                      fireBody.setSingleLine(false);
                      fireBody.setMaxLines(20);
                      fireBody.setBackgroundColor(getResources().getColor(R.color.white));
  
                      // set the margins and add to view
                      layoutParams.setMargins(10, 0, 10, 0);
                      childView.addView(fireBody,layoutParams);
  </code></pre>
  
  <p>The text from the XML file is like this:</p>
  
  <pre><code>Now is the time /n for all good men to /n come to the aid of their /n party
  </code></pre>
  
  <p>It should display as such;</p>
  
  <pre><code>Now is the time
  for all good men to
  come to the aid of their
  party
  </code></pre>
  
  <p>Is there are setting that I'm missing?</p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>\r\n works if I hard code it into my view. ie:</p>
  
  <pre><code>String fireText = "Now is the time \r\n for all good men \r\n to come to the aid";
  </code></pre>
  
  <p>Actually \n also works if i hard code it:</p>
  
  <pre><code>String fireText = "Line one\nLine two\nLine three";
  </code></pre>
  
  <p><strong><em>FYI</em></strong></p>
  
  <pre><code>System.getProperty("line.separator");
  </code></pre>
  
  <p>this returns a string of "/n" so there is no need to convert to "/r/n".</p>
  
  <p>Unfortunately, my data originates in a XML file that is parsed and stored in a hashmap. I tried the following:</p>
  
  <pre><code>String fireText = body1.toString().replaceAll("\n", "\r\n");
  </code></pre>
  
  <p>The \n is not getting replaced with \r\n.  Could it be because I'm converting from an object to String?</p>