I am trying to create a fragment with scrollable text. I have the following class extending Fragment with the two methods below. I'm getting an error "The method findViewbyID(int) is undefined for the type exampleFragmentText" and the method "stSelected(boolean) is undefined for the type exampleFragmentText" How should I be doing this?
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.textview_main, container, false); //just return the view ;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
// TODO Auto-generated method stub
//here you can initialise your variables,listeners,e.t.c ;
super.onActivityCreated(savedInstanceState);
TextView textView = (TextView) findViewbyID(R.id.myText);
textView.stSelected(true);
// addListenerOnButton();
}
protected View findViewById(int id)
{
return getView().findViewById(id);
}