Context.getString causing "no such static field"
<p>I'm trying to get a string from my strings.xml file inside an event handler, although I'm getting "No such static field".</p>

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

<pre><code>mSearchEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View view, boolean hasFocus) {
            Context context = view.getContext();

            if (hasFocus &amp;&amp; mSearchEditText.getText().toString().trim() == context.getString(R.string.searchbar_address_label)) {
                mSearchEditText.setText("");
            }
            else if (!hasFocus &amp;&amp; mSearchEditText.getText().toString().trim().isEmpty()) {
                mSearchEditText.setText(context.getString(R.string.searchbar_address_label));
            }
        }
    });
</code></pre>

<p>What is wrong with this code? </p>

<p>Thanks</p>

<p>UPDATE: This code was intended to show a hint inside the EditText. The R.string seems to be unavailable inside listener's functions. So, consider my question as "Is there a native way to show hints inside EditText instead of writing my own code?"</p>
