start=(Button)findViewById(R.id.start);
        stop=(Button)findViewById(R.id.stop);
        speed=(ProgressBar)findViewById(R.id.speed);
        start.setOnClickListener(new StartListener());
        写在onCreateView里面,findviewById前面加个rootView。

解决方案 »

  1.   

    http://bbs.csdn.net/topics/390759882
      

  2.   

    首先你必须清楚    你那三个控件是写在那个布局里面的    antivity_main   or   fragment_main
      

  3.   


    是写在fragment_main里面的,但是因为 onCreateView()方法在public static class PlaceholderFragment 里面它是一个静态类,需要将那三个控件全部变为静态的。。这个总觉着有些问题
      

  4.   

    将那三个变量放到PlaceholderFragment 里,别放activity里
      

  5.   

    放到PlaceholderFragment  中的onCreateView 方法下