开发者

In registration form adding date dialogbox how can apply validation in system date in dialog ends with system date in android

i am implementing registration form adding date field then click icon to display date dialog window then limit date validation in system date below date only how can implement the validation

protected Dialog onCreateDialog(int id) {

Calendar c = Calendar.getInstance();
int cyear = c.get(Calendar.YEAR);
int cmonth = c.get(Calendar.MONTH);
int cday = c.get(Calendar.DAY_OF_MONTH);
switch (id) {
case DATE_DIALOG_ID:
return new DatePickerDialog(this,  mDateSetListener,  cyear, cmonth, cday);
        }
    return null;
    }
private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() 
{
public void onDateSet(DatePicker view, int year, int monthOfYear, int 开发者_StackOverflowdayOfMonth)
 {
String date_selected = String.valueOf(monthOfYear+1)+" /"+String.valueOf(dayOfMonth)+" /"+String.valueOf(year);
EditText birthday=(EditText) findViewById(R.id.EditTextBirthday);
    birthday.setText(date_selected);
    }
};
public void onClick(View v) 
{
if(v == b1)
showDialog(DATE_DIALOG_ID);
    }
}

**

showing in system date in below dates only how can implemented

some solution in running year to below years are display not incrementing above years this condition are appliying validations how can implemented ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜