RadioButton selection with date picker
<p>I have a program that gets date from datepicker and also needs to get a cabin choice from radio button group. I know my error lies in the radiobutton listener, perhaps I'm not putting it in the right place. Keep in mind I am new at this!! Thanks!</p>

<pre><code>public class Main extends Activity {

    private int currentYear;
    private int currentMonth;
    private int currentDay;
    static final int DATE_DIALOG_ID = 0;
    private Button btDate;
    private TextView reservation;


    private String cabinChoice;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        btDate = (Button)findViewById(R.id.btnDate);
        reservation = (TextView)findViewById(R.id.txtReservation);
        btDate.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
            showDialog(DATE_DIALOG_ID);                                      

            }           

        });
        //---RadioButton---
        RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radiogroup1);        
        radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() 
        {
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                //---displays the ID of the RadioButton that is checked---
                switch(checkedId){
                case 0:
                    cabinChoice = "Basic";
                    break;
                case 1:
                    cabinChoice = "Deluxe";
                    break;
                }
            }
        });



        final Calendar c = Calendar.getInstance();
        currentYear = c.get(Calendar.YEAR);
        currentMonth = c.get(Calendar.MONTH);
        currentDay = c.get(Calendar.DAY_OF_MONTH);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    protected Dialog onCreateDialog(int id) {
        switch (id){
        case DATE_DIALOG_ID:
            return new DatePickerDialog(this, reservationDate, currentYear, currentMonth, currentDay);

        }   

        return null;

    }
    private DatePickerDialog.OnDateSetListener reservationDate = new DatePickerDialog.OnDateSetListener(){

        @Override
        public void onDateSet(DatePicker view, int year, int month,
                int day) {
            // TODO Auto-generated method stub
            reservation.setText("Your reservation is set for " + (month + 1)+("-") + day + ("-") + year 
            + ("") + (" thru ") + ("") + (month + 1) + ("-") + (day + 2) + ("-") + year 
            + ("in") + cabinChoice);

        }

    };
}
</code></pre>
