我有這個問題..在類型FragmentTransaction的方法Add(INT,片段,字符串)是不適用的參數(INT,片段,字符串)
The method add(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, Fragment, String)
使用內部的下面的代碼時FragenmtActivity
getSupportFragmentManager().beginTransaction().add(com.korovyansk.android.slideout.R.id.slideout_placeholder, ((Fragment)new CommentsMenuFragment()), "menu").commit();
其中CommentsMenuFragment實現:
public class CommentsMenuFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_comment, container, false);
ListView lvComments = (ListView) view.findViewById(R.id.lvComments);
return view;
}
}
你使用android.support.v4.app.Fragment還是android.app.Fragment? – 2013-03-20 07:37:47
謝謝我在下面的問題中找到了它的答案http://stackoverflow.com/questions/11753921/error-in-fragment – Adham 2013-03-20 07:41:12