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。
stop=(Button)findViewById(R.id.stop);
speed=(ProgressBar)findViewById(R.id.speed);
start.setOnClickListener(new StartListener());
写在onCreateView里面,findviewById前面加个rootView。
是写在fragment_main里面的,但是因为 onCreateView()方法在public static class PlaceholderFragment 里面它是一个静态类,需要将那三个控件全部变为静态的。。这个总觉着有些问题