スクロール可能なテキストでフラグメントを作成しようとしています。以下の 2 つのメソッドを使用して Fragment を拡張する次のクラスがあります。「メソッド findViewbyID(int) は exampleFragmentText 型に対して未定義です」というエラーが表示され、「exampleFragmentText 型に対して stSelected(boolean) は未定義です」というエラーが表示されます。
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);
}