dimanche 19 avril 2015

If statement doesnt work right

I use the code below to do some action. I check the input parameters to follow the way. With the debug output it should be the TABLENAME1 way (Log.d), but in the execution of the app its the TABLENAME2. My debug output is this:



04-19 11:56:15.337: D/Button(19894): Ausbuchen
04-19 11:56:15.337: D/isBox(19894): true
04-19 11:56:15.337: D/ART(19894): F
04-19 11:56:15.337: D/TABLENAME2(19894): IWRP_LLBX_19.04.2015


isBox is true and Art is "F" so it should be the first way, but it isnt.


can u help me why?



public void onClick(View view) {
Log.d("Button", "Ausbuchen");
betriebszahlneu = etBetriebszahl.getText().toString();
Log.d("isBox", Boolean.toString(GlobalClass.isBox));
Log.d("ART", StaffActivity.art);
if(GlobalClass.isBox = true){
if(StaffActivity.art == "F"){
GeraeteVersand geraetversand = new GeraeteVersand();
geraetversand.setEan(StaffActivity.ean);
geraetversand.setBezeichnung(StaffActivity.bezeichnung);
geraetversand.setBetriebszahl(betriebszahlneu);
geraetversand.setArt(StaffActivity.art);
geraetversand.setTablename(SelectKostActivity.KOST + "_" + StaffActivity.stammkost + "_" + GlobalClass.date);
Log.d("TABLENAME1",geraetversand.getTablename());
GlobalClass.geraeteversand.add(geraetversand);
} else {
GeraeteVersand geraetversand = new GeraeteVersand();
geraetversand.setEan(StaffActivity.ean);
geraetversand.setBezeichnung(StaffActivity.bezeichnung);
geraetversand.setBetriebszahl(betriebszahlneu);
Log.d("art", StaffActivity.art);
geraetversand.setArt(StaffActivity.art);
geraetversand.setTablename(SelectKostActivity.KOST + "_" + GlobalClass.KOST_NEW + "_" + GlobalClass.date);
Log.d("TABLENAME2",geraetversand.getTablename());
GlobalClass.geraeteversand.add(geraetversand);
}
}
else {
GeraeteVersand geraetversand = new GeraeteVersand();
geraetversand.setEan(StaffActivity.ean);
geraetversand.setBezeichnung(StaffActivity.bezeichnung);
geraetversand.setBetriebszahl(betriebszahlneu);
geraetversand.setArt(StaffActivity.art);
geraetversand.setTablename(SelectKostActivity.KOST + "_" + GlobalClass.KOST_NEW + "_" + GlobalClass.date);
Log.d("TABLENAME3",geraetversand.getTablename());
GlobalClass.geraeteversand.add(geraetversand);

}

Aucun commentaire:

Enregistrer un commentaire