出错Log是这样的,哪位大神可以指点一下吗?

解决方案 »

  1.   

    报了38行空指针,目测没取到button,打个断点试试
      

  2.   

    不对,你后面为什么要public static class PlaceholderFragment extends Fragment ,这也没关系,可是你在获取前面if (savedInstanceState == null) {
                getFragmentManager().beginTransaction()
                        .add(R.id.container, new PlaceholderFragment()).commit();
            },所以会报空。
      

  3.   


    这个函数是最新的开发环境自己加的,有两个layout
    我还是不理解你指出的那段if代码哪错了,可以具体说下嘛,不胜感激。
    下了新版本后莫名其妙多了好多错误
      

  4.   

    用最新开发环境后,每个程序运行都会报这个错,Google了下,没搜到具体的解释
      

  5.   

    @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container,
                    Bundle savedInstanceState) {
                View rootView = inflater.inflate(R.layout.fragment_mini_browser,
                        container, false);
                return rootView;
            }在这里绑定ID,自从4.2以后
      

  6.   

    最新的sdk,默认加入了框架,如果你用他的就必须在fragment中获取控件,要是你想按以前的做,就别用if (savedInstanceState == null) {
                getFragmentManager().beginTransaction()
                        .add(R.id.container, new PlaceholderFragment()).commit();
            },后面的fragment也是多余的,完全按照以前的做就行了,