我正在尝试从 Firebase 数据库中检索 9 个布尔变量和一个 int 变量,但是每次我运行我的应用程序时,它都会给我一个空指针异常
它来自一个 Android 应用程序,我设置了一个模型页面,我设置了 getter 和 setter 方法,但它一直在检索空指针 exeption 这是模型
public class ButtonInformation {
private boolean Button1=false;
private boolean Button2=false;
private boolean Button3=false;
private boolean Button4=false;
private boolean Button5=false;
private boolean Button6=false;
private boolean Button7=false;
private boolean Button8=false;
private boolean Button9=false;
private int ApeOmaggio=0;
public ButtonInformation(){
}
public ButtonInformation(boolean button1, boolean button2, boolean button3, boolean button4, boolean button5, boolean button6, boolean button7, boolean button8, boolean button9, int apeOmaggio) {
Button1 = button1;
Button2 = button2;
Button3 = button3;
Button4 = button4;
Button5 = button5;
Button6 = button6;
Button7 = button7;
Button8 = button8;
Button9 = button9;
ApeOmaggio = apeOmaggio;
}
public boolean getButton1(){
return Button1;
}
public void setButton1(boolean Button1){
this.Button1 = Button1;
}
public boolean getButton2(){
return Button2;
}
public void setButton2(boolean Button2){
this.Button2 = Button2;
}
public boolean getButton3(){
return Button3;
}
public void setButton3(boolean Button3){
this.Button3 = Button3;
}
public boolean getButton4(){
return Button4;
}
public void setButton4(boolean Button4){
this.Button4 = Button4;
}
public boolean getButton5(){
return Button5;
}
public void setButton5(boolean Button5){
this.Button5 = Button5;
}
public boolean getButton6(){
return Button6;
}
public void setButton6(boolean Button6){
this.Button6 = Button6;
}
public boolean getButton7(){
return Button7;
}
慕姐4208626
牛魔王的故事
相关分类