Why can't I get data from EditText
<p>I can't get data from an EditText <code>fr1</code>. I type some text into <code>fr1</code>, press a Button <code>btn</code> and nothing happens. TextView <code>result</code> is empty. Why is it empty? What do I do wrong? Thanks.     </p>

<pre><code>public class MainActivity extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        EditText fr1 = (EditText) findViewById(R.id.fraction1);
        final TextView result = (TextView) findViewById(R.id.result);
        Button btn = (Button) findViewById(R.id.getresult);

        final String s = fr1.getText().toString();

        btn.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                // TODO Auto-generated method stub
                result.setText(s);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
</code></pre>
