0

我想用这个按钮来增加上面片段中的片段。

请告诉我该怎么做。谢谢各位朋友。

我的想法是做一个操作界面切换一个屏幕五个按钮分别连接到不同屏幕不同屏幕有五个按钮

这是我的源代码。备注错误码

public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.indexomune, container, false);
    Button USER = (Button)view.findViewById(R.id.USER);
    USER.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
                FragmentManager user = getFragmentManager();
                FragmentTransaction User = user.beginTransaction();
                Fragment fragment = user.findFragmentById(R.id.USSER);
                if (fragment == null) {
                    String title = "Fragment A";
                    usermenu TAT = new usermenu(title);
                    user.add(R.id.USSER, TAT);
                    //The method add(int, usermenu) is undefined for the type FragmentManager
                    user.addToBackStack(null);
                    //The method addToBackStack(null) is undefined for the type FragmentManager
                    user.commit();
                    //The method commit() is undefined for the type FragmentManager
                }

        }


    });
    return view;

}
4

0 回答 0