I don't see a DialogoFecha.show(); You should call him with DialogName.show();
2011/6/21 ABSOLUT <davidt...@gmail.com> > Hi, > I'm trying to do an DatePickerDialog with two buttons. My problem is > that onDateSet never gets called. > > DatePickerDialog dialogoFecha = new DatePickerDialog(this, > mDateSetListener , mYear, mMonth, mDay); > > The Buttons: > > dialogoFecha.setButton("PONER FECHA", new > DialogInterface.OnClickListener(){ > > @Override > public void onClick(DialogInterface dialog, > int which) { > // TODO Auto-generated method stub > Log.d("PRUEBA","Han pulsado > al boton OK"); > Log.d("PRUEBA", "EL VALOR de > mYear es ......." + mYear); > if ( mYear > > c.get(Calendar.YEAR)) { > > Toast.makeText(getApplicationContext(),"FECHA IMPOSIBLE", > Toast.LENGTH_LONG).show(); > mYear = > c.get(Calendar.YEAR); > } > } > }); > > dialogoFecha.setButton2("CANCELAR", new > DialogInterface.OnClickListener(){ > > @Override > public void onClick(DialogInterface dialog, > int which) { > // TODO Auto-generated method stub > Toast.makeText( > getApplicationContext(),"no se puede cancelar", > Toast.LENGTH_LONG).show(); > } > }); > > The DataSet: > > private DatePickerDialog.OnDateSetListener mDateSetListener = new > DatePickerDialog.OnDateSetListener() { > //ESTE ES UN LISTENER CREADO -LLAMADO MDATELISTENER- QUE > DEBE TENER EL MODULO ONDATASET PARA > //CUANDO SE CAMBIEN LOS DATOS ACTUALIZAR LAS VARIABLES MYEAR, > MMONT Y MDAY. > public void onDateSet(DatePicker view, int year, > int monthOfYear, int dayOfMonth) { > Log.d("PRUEBA","Entramos en el listener"); > mYear = year; > mMonth = monthOfYear; > mDay = dayOfMonth; > } > }; > > Could you help me please? > Many thanks, > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Jorge Luis Ferrari Cé Desenvolvedor / Web Designer Siga @JLFerrari -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en