I'm writing programs with a simple Fragment and I got an error as below:
FrameLayout fl=new FrameLayout(this);
fl.setId(0x1024);
setContentView(fl);
FragmentTransaction ftransc=getFragmentManager().beginTransaction();
FragmentTest2 myFragment=new FragmentTest2();
ftransc.add(fl.getId(), myFragment, "FirstFragment");
ftransc.commit();
Under the add method I get a red squiggly line and the following error shows:
The method
add(int, Fragment, Stringin the typeFragmentTransactionis not applicable for the arguments(int, FragmentTest2, String).
What am I doing wrong?