• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps cannot find symbol method findViewById(int)

jon80

Member
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.sample_action) {
clearLog();
}

EditText editText = (EditText) findViewById(R.id.edit_message);
editText.setText('X', null);

return true;
}
Error:(67, 40) error: cannot find symbol method findViewById(int)

Am I missing an import statement?
 
Can I switch off emocticons and include <code> tags in this forum, so that they can be pasted within IDEs?
 
You can also use the [plain][/plain] tags to disable BBcode on a block of text.

Like this:
[plain]:)[/plain]
:)

:)
 
Back
Top Bottom