我有一个在content_main上创建的OnTrigger
public class ContainMain extends Activity implements OnTriggerListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SlideBar slideToUnLock = (SlideBar)findViewById(R.id.slideBar);
slideToUnLock.setOnTriggerListener(this);
}
@Override
public void onTrigger() {
Log.d("Teset", "Slide Trigged");
}
}
当我在content_main上运行应用程序时,它会显示Log.d 当我在activity_main中运行它时,它会崩溃并且错误日志表示空指针