How to set a hint when the user leaves the text-box empty and tries to proceed?
<p>I am trying to set a hint when a user leaves the text-box empty and tries to proceed by  clicking the centre key, but am getting an error on one of the semi_colons. </p>

<p>Here is my code:</p>

<pre><code>    String defaultName = "";
    Bundle extras = getIntent().getExtras();

    if (extras!=null) {
        defaultName = extras.getString("Name");  
        EditText txt = (EditText)findViewById(R.id.name);
        txt.setHint(defaultName);
    } else {      

        @Override
        public boolean onKeyDown(int keyCode, KeyEvent event){
        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {          

        }
        return false;
    }
}   
</code></pre>
