我有点迷失在这里,我收到了错误:
Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
这是重要的代码:
public class MainActivity extends AppCompatActivity {
SeekBar chestValue;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
chestValue = (SeekBar)findViewById(R.id.chestValueSlider);
}
行" SeekBar chestValue;"是什么根据堆栈跟踪给出错误。有什么建议吗?