how to set text of TextView
<p>Im facing a problem of setting the text of TextView in android my code is :</p>

<pre><code>package som.arshay.dev;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Main extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button button = (Button) findViewById(R.id.button1);
        final TextView text = (TextView) findViewById(R.id.textView1);
        final EditText input = (EditText) findViewById(R.id.editText1);
        final String string = input.getText();
        button.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                text.setText(string);                   
            }
        });
    }
}
</code></pre>

<p>if I write </p>

<pre><code>    final Editable string = input.getText();
</code></pre>

<p>then it works.....!!!!</p>

<p>Now i want to send data of EditText to nex Activity like this</p>

<pre><code>package som.arshay.dev;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Main extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button button = (Button) findViewById(R.id.button1);
        final TextView text = (TextView) findViewById(R.id.textView1);
        final EditText input = (EditText) findViewById(R.id.editText1);
        final Editable string = input.getText();
        button.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub

                Intent intent = new Intent(Main.this, Second.class);
                intent.putExtra("thetext", string);

                startActivity(intent);
            }
        });
    }
}
</code></pre>

<p>and in Second.java class I get in this way:</p>

<pre><code>package som.arshay.dev;

import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.widget.TextView;

public class Second extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second);

        TextView text = (TextView) findViewById(R.id.textView2);
        String string = getIntent().getExtras().getString("thetext", "not found");
        text.setText(string); /////    Here the text is not shown but the default message "not found"
    }
}
</code></pre>

<p>Please give me way to proceed in development.....
Thanks in Advance And Happy Android Dev ;-) </p>
