views:

17

answers:

1

Booking.java

This is part of my spinner code.

public void onItemSelected(AdapterView<?> arg0, View v,int position, long id)
{
    boolean result = Booking.this.myCursor.moveToPosition(position);
    if (result) {
        String title=Booking.this.myCursor.getString(2);
       Booking.this.txtArrival.setText(title);
    }
 }

There is still an error if i implement this statement

    else (result){
        String title2 = Booking.this.myCursor.getString(3);
        Booking.this.txtArrival.setText(title2);
    }

Insert ; to complete statement. insert"AssignmentOperator Expression" to complete Assignment

How would i go about solving it?

Thank you.

+1  A: 

An else statement does not allow parameters... you must do:

if (result) {
    String title=Booking.this.myCursor.getString(2);
   Booking.this.txtArrival.setText(title);
}
else{
    String title2 = Booking.this.myCursor.getString(3);
    Booking.this.txtArrival.setText(title2);
}
Cristian
Thanks for your help. =P
User358218