I’ve got the following code:
int bookingType=0;
//mapSize=mapLoaded.size();
DateTime startx = new DateTime(startDate.getTime());
DateTime endx = new DateTime(endDate.getTime());
//booking status
boolean possible = false;
//Booking type: 1 = Project, 2 = Training
if(requestType.equals("Project")){
bookingType = 1;
}else if(requestType.equals("Training")){
bookingType = 2;
}
//produces submap
//mapSize = bookingType;
bookingType = 1;
if(bookingType==1)
{
.....
}else if(bookingType==2){
....
}
The error after testing is when am checking value of bookingType. usually the == would work but here it seems to be skipping it altogether. I checked the value of bookingType and it does change to 1 or 2 based on requestType. Why is the if() not working?
Thanks,
According to your code it should go to first if condition.
Can you please put the else condition and print the value in bookingType ?
And also make sure that you do not set bookingType in any other place. It will be more helpful if you could provide more complete code sample.
And provide how do you determine the if condition check is not working and error.