title: Dynamically changing the text of a TextView
body: <p>I have a TextView that starts out with a default text value, and then based on what a user does, that TextView's text needs to change in the code when a button is clicked. Seems simple enough, yet I'm running into problems. </p>
  
  <p>Currently, what is happening is when the user clicks the submit button which triggers the change of the text, the new text is just being added to the screen under the original TextView instead of just simply changing the text value. It's almost as if it's adding a new TextView.</p>
  
  <p>Here is the code that does this:</p>
  
  <pre><code>lblSlogan.Invalidate();
  lblSlogan.SetText(currentSlogan.Slogan, TextView.BufferType.Normal);
  </code></pre>
  
  <p>I also tried it this way, with no luck:</p>
  
  <pre><code>lblSlogan.Invalidate();
  lblSlogan.Text = currentSlogan.Slogan;
  </code></pre>
  
  <p>lblSlogan is a TextView. Am I missing something? I also tried it without the invalidate(), but that changed nothing either.</p>
  
  <p>Thanks.</p>
  
  <p>-- edit --</p>
  
  <p>It's important to note that I'm using C# with Xamarin. Not Java. Here is my click method for the button. This is where the TextView change happens.</p>
  
  <pre><code>btnOk.Click += delegate(object sender, EventArgs e)
        {
              if (answerBox.Text.ToLower() == currentSlogan.Company.ToLower())
              {
                  // correct answer
                  currentUserScore += currentSlogan.Points;
                  currentSlogan.Answered = true;
                  DatabaseBuffer.MarkSloganAnsweredAndUpdateScore(currentSlogan, currentUserScore);
                  currentSlogan = DatabaseBuffer.GetNextUnansweredSlogan(currentSlogan.ID);
              }
  
              if (currentUserScore &gt;= pointsToPass)
              {
                  // user has beaten level
              }
              else
              {
                  lblSlogan.SetText(currentSlogan.Slogan, TextView.BufferType.Normal);
                  answerBox.Text = "";
              }
          };
  </code></pre>