私はこの問題を抱えている。..メソッド型FragmentTransactionに(int型、フラグメント、String)を追加すると、引数には適用されません(int型、フラグメント、String)を
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を使用していますか? –
ありがとうございました。次の質問の答えを見つけました。http://stackoverflow.com/questions/11753921/error-in-fragment – Adham