How do I show a toast whenever the user enters a word?
<p>I have a simple layout with an EditText and a Button. I want a toast to appear whenever the user enters a particular word in the EditText. How might I do that?</p>

<pre><code>Button btn;
EditText edt;
String Event;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    btn=(Button)findViewById(R.id.Button1);
    edt=(EditText)findViewById(R.id.editText1);
    btn.setOnClickListener(this);
    Event=new String(edt.getText().toString());
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

@Override
public void onClick(View arg0) {
    // TODO Auto-generated method stub
    if(Event.equals("Test")){
        Toast.makeText(this, "Great!",Toast.LENGTH_LONG).show();
    }

}
</code></pre>

<p>}</p>
