title: Difference between setText() and append()
body: <p>I'm curious about the difference setText() and append() are creating. I'm writing a very basic editor with line numbers. I have a TextView to hold line numbers on the left, paired with an EditText on the right to hold the data. Here's the XML:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent" 
      android:gravity="top"&gt;
      &lt;TextView
          android:id="@+id/line_numbers"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginRight="0dip"
          android:gravity="top"
          android:textSize="14sp"
          android:textColor="#000000"
          android:typeface="monospace"
          android:paddingLeft="0dp"/&gt;
      &lt;EditText
          android:id="@+id/editor"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:inputType="text|textMultiLine|textNoSuggestions"
          android:imeOptions="actionNone"
          android:gravity="top"
          android:textSize="14sp"
          android:textColor="#000000"
          android:typeface="monospace"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Ignoring some of the other things I'm doing, the most curious thing I came across was the extra spacing that showed up when I used append() (assuming things have been initialized and all that).</p>
  
  <p>This below, in combination with the XML, sets a flush border between the TextView and EditText.</p>
  
  <pre><code>theEditor = (EditText) findViewById(R.id.editor);
  lineNumbers = (TextView) findViewById(R.id.line_numbers);
  theLineCount = theEditor.getLineCount();
  lineNumbers.setText(String.valueOf(theLineCount)+"\n");
  </code></pre>
  
  <p>Change the last line to this, though, and suddenly each line in the TextView has padding on the right before the EditText.</p>
  
  <pre><code>lineNumbers.append(String.valueOf(theLineCount)+"\n");
  </code></pre>
  
  <p>It's not the end of the world. but I was curious what was causing this behavior. Since I'm new to the language, the only thing I could think of was maybe, when append throws the Editable on there, it adds the padding. If I can get an answer, I get to replace all of these nasty lines with simpler appends:</p>
  
  <pre><code>lineNumbers.setText(lineNumbers.getText().toString()+String.valueOf(newLineCount)+"\n");
  </code></pre>