title: Android setText() Syntax Error On Tokens
body: <p>Okay, I've got the makings of a really simple Android program here.  I decided to start out with something simple but also relatively useful.  Eventually, I hope to have an application that stores and displays study cards.  I feel like not being able to get past a TextView is a bad omen.  I've looked at several dozen examples and researched common problems new users have with setText(), but to no avail.  Here are the relevant lines of code:</p>
  
  <p>From my .java file:</p>
  
  <pre><code>import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.widget.TextView;
  
  public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  TextView tv1 = (TextView) findViewById(R.id.TextView1);
  tv1.setText("New text");
  </code></pre>
  
  <p>.... and so on</p>
  
  <p>Eclipse is marking the line containing "setText" and giving me the following syntactical errors: </p>
  
  <p>Syntax error on token(s), misplaced construct(s) //underlining the period after tv1</p>
  
  <p>Syntax error on token ""New text"", delete this token</p>