That method is not defined in the Fragment class which is where I assume you're calling it. You have to use it on the View that the Fragment is showing. This is the same view that you return in onCreateView()
and you can retrieve it by getView()
. Thus, TextView txtMyTextBox = (TextView)getView().findViewById(R.id.my_text_box)
should work.