title: Why isn't the TextView working?
body: <p>I'm coding an android program that arranges three words in alphabetical order using two simple activities.But in the second(output) activity,either the TextView or the Intents aren't working.The output isn't getting displayed.The java code for first(input) activity is as follows:
      `package com.example.names;</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Toast;
  
  public class Input extends Activity {
  EditText t1,t2,t3;
  final Context context=this;
  
  String n[]=new String[100];
  String t[]=new String[100];
  
  String a1,a2,a3;
  Button alpha;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.input);
      t1=(EditText)findViewById(R.id.editText1);
      t2=(EditText)findViewById(R.id.editText2);
      t3=(EditText)findViewById(R.id.editText3);
  n[0]=t1.getText().toString();
  n[1]=t2.getText().toString();
  n[2]=t3.getText().toString();
  for(int j=0;j&lt;2;j++) 
      {
          for(int k=j+1;k&lt;3;k++)
      {
      if(n[j].compareToIgnoreCase(n[k])&gt;0)
          {
          String temp=n[j];
          n[j]=n[k];
          n[k]=temp;
          }
      }
      }
     a1=n[0];
      a2=n[1];
      a3=n[2];
     alpha=(Button)findViewById(R.id.button1);
     alpha.setOnClickListener(new OnClickListener() {
  
      public void onClick(View v) {
          // TODO Auto-generated method stub
          Intent i=new Intent(Input.this,Output.class);
          i.putExtra("x", a1+a2+a3);
  
             Toast.makeText(Input.this, "Method OnClick has been invoked",Toast.LENGTH_SHORT).show();
             startActivity(i);    
      }
  });}}`
  </code></pre>
  
  <p>And the java code for second activity is as follows:</p>
  
  <pre><code>package com.example.names;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class Output extends Activity {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
     TextView p1=new TextView(this);
  
     Bundle extras=getIntent().getExtras();
  
     if (extras!=null){
   String ans=extras.getString("x");
     p1.setText(ans);
     p1.setTextSize(50);
     Toast.makeText(Output.this, "All lines have been executed",Toast.LENGTH_LONG).show();
     setContentView(p1);
  
  }};}
  </code></pre>
  
  <p>Why isn't the output getting displayed then???
  The application is not crashing also.</p>