那個add();怎么一直顯示錯誤 錯誤提示The method add(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment2)說是要把上面的 MyFragment2 fragment2=new MyFragment2();
case R.id.second :{
? ? ? ?MyFragment2 fragment2=new MyFragment2();
? ? ? ? ? ? FragmentManager fragmentManager = getFragmentManager();
? ? ? ? ? ? FragmentTransaction beginTransaction = fragmentManager.beginTransaction();
? ? ? ? ? ? beginTransaction.add(R.id.frame, fragment2);
? ?
break;
2016-07-21
可能是導包導錯了 你看看